Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-25488

Expose cache statistics via REST (EntityBroker)

    XMLWordPrintable

    Details

      Description

      Expose via REST (EntityBroker) the current systems cache information.

      Sample output for a particular cache name (id):

      { "averageGetTime": 0.018181818, "averageSearchTime": 0, "cacheHitRatio": 96, "cacheHits": 53, "cacheMisses": 2, "cacheSize": 2, "diskHitRatio": 0, "diskStoreSize": 0, "evictionCount": 0, "id": "org.sakaiproject.authz.api.SecurityService.cache", "inMemoryHits": 53, "inMemoryMisses": 2, "memoryHitRatio": 96, "memoryStoreSize": 2, "offHeapHits": 0, "offHeapMisses": 0, "offHeapStoreSize": 0, "onDiskHits": 0, "onDiskMisses": 0, "searchesPerSecond": 0, "statisticsAccuracy": "best effort", "writerQueueLength": -1, "entityReference": "\/cache\/org.sakaiproject.authz.api.SecurityService.cache", "entityURL": "http:\/\/localhost:8080\/direct\/cache\/org.sakaiproject.authz.api.SecurityService.cache", "entityId": "org.sakaiproject.authz.api.SecurityService.cache" }

      There are three custom actions:
      cacheSummary - includes cache name, hit, size, ratio
      cacheNames - just the cache names
      memory - current jvm memory

      The following ratios are calculated like so:

      cacheHitRatio = (cacheHits + cacheMisses) > 0 ? (100L * cacheHits) / (cacheHits + cacheMisses) : 0;
      diskHitRatio = (onDiskHits + onDiskMisses) > 0 ? (100L * this.onDiskHits) / (onDiskHits + onDiskMisses) : 0;
      memoryHitRatio = (inMemoryHits + inMemoryMisses) > 0 ? (100L * this.inMemoryHits) / (inMemoryHits + inMemoryMisses) : 0;

      There maybe other information that people are interested in please open a subsequent JIRA and link to this one.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ern Earle R Nietzel
                  Reporter:
                  ern Earle R Nietzel
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:

                    Git Source Code