jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1488605 - in /jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki: mgt/StatsServlet.java server/DatasetRef.java
Date Sat, 01 Jun 2013 21:23:19 GMT
Author: andy
Date: Sat Jun  1 21:23:19 2013
New Revision: 1488605

URL: http://svn.apache.org/r1488605
Log:
JSON stats results.

Modified:
    jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/mgt/StatsServlet.java
    jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/DatasetRef.java

Modified: jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/mgt/StatsServlet.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/mgt/StatsServlet.java?rev=1488605&r1=1488604&r2=1488605&view=diff
==============================================================================
--- jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/mgt/StatsServlet.java (original)
+++ jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/mgt/StatsServlet.java Sat
Jun  1 21:23:19 2013
@@ -82,13 +82,19 @@ public class StatsServlet extends HttpSe
         stats.put(CounterName.RequestsGood.name(),  desc.counters.value(CounterName.RequestsGood))
;
         stats.put(CounterName.RequestsBad.name(),   desc.counters.value(CounterName.RequestsBad))
;
         JsonObject services = new JsonObject() ;
+
+//        JsonArray endpoints = new JsonArray() ;
+//        services.put("endpoints", endpoints) ;
+//        JsonArray srvNames = new JsonArray() ;
+//        services.put("names", srvNames) ;
+        
         // There can be several endpoints for one service.
         for ( ServiceRef srvRef : desc.getServiceRefs() ) {
             JsonObject epStats = new JsonObject() ;
             statsJSON(epStats, srvRef) ;
             services.put(srvRef.name, epStats) ;
             JsonArray endpoints = new JsonArray() ;
-            services.put("endpoints", endpoints) ;
+            epStats.put("endpoints", endpoints) ;
             for ( String ep : srvRef.endpoints) {
                 endpoints.add(ep) ;
             }

Modified: jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/DatasetRef.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/DatasetRef.java?rev=1488605&r1=1488604&r2=1488605&view=diff
==============================================================================
--- jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/DatasetRef.java (original)
+++ jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/DatasetRef.java Sat
Jun  1 21:23:19 2013
@@ -31,23 +31,18 @@ public class DatasetRef implements Datas
     public String name                          = null ;
     public DatasetGraph dataset                 = null ;
 
-    private List<ServiceRef> serviceRefs         = new ArrayList<ServiceRef>()
;
-    private ServiceRef createService(String name) {
-        ServiceRef sr = new ServiceRef(name) ; 
-        serviceRefs.add(sr) ;
-        return sr ;
-    }
     
-    public ServiceRef query                     = createService("query") ;
-    public ServiceRef update                    = createService("update") ;
-    public ServiceRef upload                    = createService("upload") ;
-    public ServiceRef readGraphStore            = createService("gspRead") ;
-    public ServiceRef readWriteGraphStore       = createService("gspReadWrite") ; 
+    public ServiceRef query                     = new ServiceRef("query") ;
+    public ServiceRef update                    = new ServiceRef("update") ;
+    public ServiceRef upload                    = new ServiceRef("upload") ;
+    public ServiceRef readGraphStore            = new ServiceRef("gspRead") ;
+    public ServiceRef readWriteGraphStore       = new ServiceRef("gspReadWrite") ; 
     
     
     // Dataset-level counters.
     public final CounterSet counters            = new CounterSet() ;
     private Map<String, ServiceRef> endpoints   = new HashMap<String, ServiceRef>()
;
+    private List<ServiceRef> serviceRefs        = new ArrayList<ServiceRef>()
;
     private boolean initialized = false ;
     
     // Two step initiation (c.f. Builder pattern)
@@ -61,17 +56,17 @@ public class DatasetRef implements Datas
     }
     
     private void initServices() {
-        add(endpoints, query) ;
-        add(endpoints, update) ;
-        add(endpoints, upload) ;
-        add(endpoints, readGraphStore) ;
-        add(endpoints, readWriteGraphStore) ;
+        add(query) ;
+        add(update) ;
+        add(upload) ;
+        add(readGraphStore) ;
+        add(readWriteGraphStore) ;
     }
     
-    private static void add(Map<String, ServiceRef> serviceRefs, ServiceRef srvRef)
-    {
+    private void add(ServiceRef srvRef) {
+        serviceRefs.add(srvRef) ;
         for ( String ep : srvRef.endpoints )
-            serviceRefs.put(ep, srvRef) ; 
+            endpoints.put(ep, srvRef) ;
     }
 
     public ServiceRef getServiceRef(String service) {
@@ -82,10 +77,6 @@ public class DatasetRef implements Datas
         return endpoints.get(service) ;
     }
 
-    public Collection<String> ZgetEndpoints() {
-        return endpoints.keySet() ;
-    }
-
     public Collection<ServiceRef> getServiceRefs() {
         return serviceRefs ;
     }



Mime
View raw message