usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [19/50] [abbrv] usergrid git commit: Tweak heap status to return used heap, and changed endpoint to status/heap.
Date Mon, 02 May 2016 17:54:50 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/14f7e29e
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/14f7e29e
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/14f7e29e

Branch: refs/heads/USERGRID-1246-MASTER
Commit: 14f7e29efb37996f3cd4e256bb5120656129dfcc
Parents: fa5b19f
Author: Mike Dunker <mdunker@apigee.com>
Authored: Thu Apr 21 11:07:08 2016 -0700
Committer: George Reyes <grey@apache.org>
Committed: Mon May 2 10:49:34 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/14f7e29e/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