usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [34/52] [abbrv] usergrid git commit: Tweak heap status to return used heap, and changed endpoint to status/heap.
Date Mon, 23 May 2016 14:17:17 GMT
Tweak heap status to return used heap, and changed endpoint to status/heap.


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/70da5a2c
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/70da5a2c
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/70da5a2c

Branch: refs/heads/asf-site
Commit: 70da5a2c01e71ec6f72895222a237537eb91a4e4
Parents: 11ee98a
Author: Mike Dunker <mdunker@apigee.com>
Authored: Thu Apr 21 11:07:08 2016 -0700
Committer: Mike Dunker <mdunker@apigee.com>
Committed: Thu Apr 21 11:07:08 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/usergrid/rest/RootResource.java   | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/70da5a2c/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java
index 9701105..b8abe54 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/RootResource.java
@@ -249,22 +249,24 @@ public class RootResource extends AbstractContextResource implements
MetricProce
     }
 
     @GET
-    @Path("/status/memory")
+    @Path("/status/heap")
     @JSONP
     @Produces({MediaType.APPLICATION_JSON, "application/javascript"})
-    public ApiResponse getMemoryStats(){
+    public ApiResponse getHeapStats(){
 
         ApiResponse response = createApiResponse();
 
         ObjectNode node = JsonNodeFactory.instance.objectNode();
 
-        long heapSize = Runtime.getRuntime().totalMemory();
+        long heapAllocatedSize = Runtime.getRuntime().totalMemory();
         long heapMaxSize = Runtime.getRuntime().maxMemory();
         long heapFreeSize = Runtime.getRuntime().freeMemory();
+        long heapUsedSize = heapAllocatedSize - heapFreeSize;
 
-        node.put( "currentHeap", org.apache.usergrid.utils.StringUtils.readableByteSize(heapSize)
);
-        node.put( "maxHeap", org.apache.usergrid.utils.StringUtils.readableByteSize(heapMaxSize)
);
-        node.put( "freeHeap", org.apache.usergrid.utils.StringUtils.readableByteSize(heapFreeSize)
);
+        node.put( "used", org.apache.usergrid.utils.StringUtils.readableByteSize(heapUsedSize)
);
+        node.put( "free", org.apache.usergrid.utils.StringUtils.readableByteSize(heapFreeSize)
);
+        node.put( "allocated", org.apache.usergrid.utils.StringUtils.readableByteSize(heapAllocatedSize)
);
+        node.put( "max", org.apache.usergrid.utils.StringUtils.readableByteSize(heapMaxSize)
);
 
         response.setProperty( "status", node );
         return response;


Mime
View raw message