Class NodeStatsActionResponse

java.lang.Object
org.frontcache.io.ActionResponse
org.frontcache.io.NodeStatsActionResponse

public class NodeStatsActionResponse extends ActionResponse
The cheap, pollable view of a node: cache sizes and the JVM they live in.

Why this is not get-cache-state

CacheStatusActionResponse carries a Map<String, String> built for human display, and producing it costs a fresh Lucene DirectoryReader on every call. That is the right trade for an operator opening a console page and the wrong one for a console that polls every ten seconds forever. This response is typed, and every number behind it is read from state the process already holds - see CacheStats, which exists for exactly this distinction. get-cache-state is unchanged and remains the complete view.

Unknown is a value, and it does not add up

Every field can be -1, meaning this node does not track it - a processor with no on-disk tier has no index size, and a non-HotSpot JVM reports no process CPU. A reader must render that as "unknown" rather than as zero. getCachedEntries() follows from that: it is the sum of the two tiers, but only when BOTH are known. A total that quietly means "L2 only, because L1 was unavailable" is worse than no total, because nothing about it looks wrong.
  • Constructor Details

    • NodeStatsActionResponse

      public NodeStatsActionResponse()
    • NodeStatsActionResponse

      public NodeStatsActionResponse(CacheStats cacheStats, FcNodeStats nodeStats)
  • Method Details

    • getCachedEntries

      public long getCachedEntries()
      Entries across both tiers, or -1 when either tier does not report.
    • setCachedEntries

      public void setCachedEntries(long cachedEntries)
    • getL1Entries

      public long getL1Entries()
    • setL1Entries

      public void setL1Entries(long l1Entries)
    • getL1Evictions

      public long getL1Evictions()
    • setL1Evictions

      public void setL1Evictions(long l1Evictions)
    • getL1ContentBytes

      public long getL1ContentBytes()
      Bytes of response CONTENT held in memory - not the tier's retained heap.
    • setL1ContentBytes

      public void setL1ContentBytes(long l1ContentBytes)
    • getL2Entries

      public long getL2Entries()
    • setL2Entries

      public void setL2Entries(long l2Entries)
    • getL2DiskBytes

      public long getL2DiskBytes()
    • setL2DiskBytes

      public void setL2DiskBytes(long l2DiskBytes)
    • getHeapUsedBytes

      public long getHeapUsedBytes()
    • setHeapUsedBytes

      public void setHeapUsedBytes(long heapUsedBytes)
    • getHeapMaxBytes

      public long getHeapMaxBytes()
    • setHeapMaxBytes

      public void setHeapMaxBytes(long heapMaxBytes)
    • getCpuProcessLoad

      public double getCpuProcessLoad()
      0..1 across all cores, or -1 when the JVM does not report it.
    • setCpuProcessLoad

      public void setCpuProcessLoad(double cpuProcessLoad)
    • getUptimeMillis

      public long getUptimeMillis()
    • setUptimeMillis

      public void setUptimeMillis(long uptimeMillis)