31.0 Cache Statistics APIs

WAS THIS PAGE HELPFUL? Leave Feedback

31.0 Cache Statistics APIs

Provides one API for retrieving all database caches statistics. These statistics are a snapshot of the Hibernate entity caches at a point in time.

31.1 List Cache Statistics

Retrieves a list of all Hibernate database cache statistics. A list of caches is returned, with each cache having cache counts including number of cache hits and misses, the number of bytes used by each cache, the number of objects in each cache, initial allocated size and more. This API should not be run repeatedly, but instead should be called once to capture database cache statistics under heavy load to determine performance issues like:

  • is a cache too small?
  • are there more cache hits than misses?
  • is the cache taking up too many bytes?

From these statistics, you can tune the cache to optimize performance.

31.1.1 Method: GET Cache Statistics

GET /api/cache

31.1.2 HTTP Query and Path Parameters

This API supports no query parameters

31.1.3 HTTP Headers
Header Valid Values Required
Content-Type application/xml or application/JSON True
GWOS-API-TOKEN a valid token returned from login True
GWOS-APP-NAME your application name True
31.1.4 Query Fields

none

31.1.5 Example Results in JSON
{
  "caches" : [
  {
    "name" : "com.groundwork.collage.model.impl.PropertyType",
    "averageGetTime" : 0.0,
    "cacheHits" : 15772,
    "cacheMisses" : 1139,
    "diskStoreSize" : 0,
    "evictionCount" : 0,
    "inMemoryHits" : 0,
    "inMemorySize" : 67265,
    "memoryStoreSize" : 50,
    "objectCount" : 50,
    "size" : 50,
    "onDiskHits" : 0,
    "maxElementsInMemory" : 10000,
    "maxElementsOnDisk" : 0,
    "timeToIdle" : 0,
    "timeToLive" : 300
  }, {
    "name" : "com.groundwork.collage.model.impl.ServiceStatus",
    "averageGetTime" : 0.0,
    "cacheHits" : 177301,
    "cacheMisses" : 1025,
    "diskStoreSize" : 0,
    "evictionCount" : 0,
    "inMemoryHits" : 0,
    "inMemorySize" : 1486563,
    "memoryStoreSize" : 1025,
    "objectCount" : 1025,
    "size" : 1025,
    "onDiskHits" : 0,
    "maxElementsInMemory" : 20000,
    "maxElementsOnDisk" : 0,
    "timeToIdle" : 0,
    "timeToLive" : 0
  }, {
    "name" : "com.groundwork.collage.model.impl.Device",
    "averageGetTime" : 0.0,
    "cacheHits" : 90314,
    "cacheMisses" : 5142,
    "diskStoreSize" : 0,
    "evictionCount" : 0,
    "inMemoryHits" : 0,
    "inMemorySize" : 207672,
    "memoryStoreSize" : 161,
    "objectCount" : 161,
    "size" : 161,
    "onDiskHits" : 0,
    "maxElementsInMemory" : 10000,
    "maxElementsOnDisk" : 0,
    "timeToIdle" : 0,
    "timeToLive" : 300
  }, {
    "name" : "com.groundwork.collage.model.impl.Host",
    "averageGetTime" : 0.0,
    "cacheHits" : 92567,
    "cacheMisses" : 161,
    "diskStoreSize" : 0,
    "evictionCount" : 0,
    "inMemoryHits" : 0,
    "inMemorySize" : 212206,
    "memoryStoreSize" : 161,
    "objectCount" : 161,
    "size" : 161,
    "onDiskHits" : 0,
    "maxElementsInMemory" : 3500,
    "maxElementsOnDisk" : 0,
    "timeToIdle" : 0,
    "timeToLive" : 0
  }
  ]
}

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<caches>
    <cache name="com.groundwork.collage.model.impl.PropertyType" averageGetTime="0.0" cacheHits="75" cacheMisses="63"
           diskStoreSize="0" evictionCount="0" inMemoryHits="0" inMemorySize="84703" memoryStoreSize="63"
           objectCount="63" size="63" onDiskHits="0" maxElementsInMemory="10000" maxElementsOnDisk="0" timeToIdle="0"
           timeToLive="300"/>
    <cache name="com.groundwork.collage.model.impl.ServiceStatus" averageGetTime="0.0" cacheHits="4728"
           cacheMisses="952" diskStoreSize="0" evictionCount="0" inMemoryHits="0" inMemorySize="1431094"
           memoryStoreSize="952" objectCount="952" size="952" onDiskHits="0" maxElementsInMemory="10000"
           maxElementsOnDisk="0" timeToIdle="0" timeToLive="300"/>
    <cache name="com.groundwork.collage.model.impl.Device" averageGetTime="0.0" cacheHits="591" cacheMisses="119"
           diskStoreSize="0" evictionCount="0" inMemoryHits="0" inMemorySize="153280" memoryStoreSize="119"
           objectCount="119" size="119" onDiskHits="0" maxElementsInMemory="10000" maxElementsOnDisk="0" timeToIdle="0"
           timeToLive="300"/>
    <cache name="com.groundwork.collage.model.impl.Host" averageGetTime="0.0" cacheHits="591" cacheMisses="119"
           diskStoreSize="0" evictionCount="0" inMemoryHits="0" inMemorySize="158093" memoryStoreSize="119"
           objectCount="119" size="119" onDiskHits="0" maxElementsInMemory="10000" maxElementsOnDisk="0" timeToIdle="0"
           timeToLive="300"/>
    <cache name="com.groundwork.collage.model.impl.HostStatus" averageGetTime="0.0" cacheHits="591" cacheMisses="119"
           diskStoreSize="0" evictionCount="0" inMemoryHits="0" inMemorySize="164577" memoryStoreSize="119"
           objectCount="119" size="119" onDiskHits="0" maxElementsInMemory="10000" maxElementsOnDisk="0" timeToIdle="0"
           timeToLive="300"/>
</caches>
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.