@InterfaceAudience.Private public class CacheStats extends Object
Modifier and Type | Field and Description |
---|---|
private com.yammer.metrics.core.Histogram |
ageAtEviction
Keep running age at eviction time
|
(package private) static int |
DEFAULT_WINDOW_PERIODS
Sliding window statistics.
|
private AtomicLong |
evictedBlockCount
The total number of blocks that have been evicted
|
private AtomicLong |
evictionCount
The number of times an eviction has occurred
|
private AtomicLong |
failedInserts
The total number of blocks that were not inserted.
|
private AtomicLong |
hitCachingCount
The number of getBlock requests that were cache hits, but only from
requests that were set to use the block cache.
|
private long[] |
hitCachingCounts
Caching hit counts for each period in window
|
private AtomicLong |
hitCount
The number of getBlock requests that were cache hits
|
private long[] |
hitCounts
Hit counts for each period in window
|
private long |
lastHitCachingCount
Last hit caching count read
|
private long |
lastHitCount
Last hit count read
|
private long |
lastRequestCachingCount
Last request caching count read
|
private long |
lastRequestCount
Last request count read
|
private static com.yammer.metrics.core.MetricsRegistry |
METRICS
Needed making histograms.
|
private AtomicLong |
missCachingCount
The number of getBlock requests that were cache misses, but only from
requests that were set to use the block cache.
|
private AtomicLong |
missCount
The number of getBlock requests that were cache misses
|
private int |
numPeriodsInWindow
The number of metrics periods to include in window
|
private AtomicLong |
primaryEvictedBlockCount
The total number of blocks for primary replica that have been evicted
|
private AtomicLong |
primaryHitCount
The number of getBlock requests that were cache hits from primary replica
|
private AtomicLong |
primaryMissCount
The number of getBlock requests for primary replica that were cache misses
|
private long[] |
requestCachingCounts
Caching access counts for each period in window
|
private long[] |
requestCounts
Access counts for each period in window
|
private long |
startTime |
private int |
windowIndex
Current window index (next to be updated)
|
Constructor and Description |
---|
CacheStats(String name) |
CacheStats(String name,
int numPeriodsInWindow) |
private static final com.yammer.metrics.core.MetricsRegistry METRICS
static final int DEFAULT_WINDOW_PERIODS
private final AtomicLong hitCount
private final AtomicLong primaryHitCount
private final AtomicLong hitCachingCount
private final AtomicLong missCount
private final AtomicLong primaryMissCount
private final AtomicLong missCachingCount
private final AtomicLong evictionCount
private final AtomicLong evictedBlockCount
private final AtomicLong primaryEvictedBlockCount
private final AtomicLong failedInserts
private final int numPeriodsInWindow
private final long[] hitCounts
private final long[] hitCachingCounts
private final long[] requestCounts
private final long[] requestCachingCounts
private long lastHitCount
private long lastHitCachingCount
private long lastRequestCount
private long lastRequestCachingCount
private int windowIndex
private com.yammer.metrics.core.Histogram ageAtEviction
private long startTime
public CacheStats(String name)
public CacheStats(String name, int numPeriodsInWindow)
public void miss(boolean caching, boolean primary)
public void hit(boolean caching)
public void hit(boolean caching, boolean primary)
public void evict()
public void evicted(long t, boolean primary)
public long failInsert()
public long getRequestCount()
public long getRequestCachingCount()
public long getMissCount()
public long getPrimaryMissCount()
public long getMissCachingCount()
public long getHitCount()
public long getPrimaryHitCount()
public long getHitCachingCount()
public long getEvictionCount()
public long getEvictedCount()
public long getPrimaryEvictedCount()
public double getHitRatio()
public double getHitCachingRatio()
public double getMissRatio()
public double getMissCachingRatio()
public double evictedPerEviction()
public long getFailedInserts()
public void rollMetricsPeriod()
public long getSumHitCountsPastNPeriods()
public long getSumRequestCountsPastNPeriods()
public long getSumHitCachingCountsPastNPeriods()
public long getSumRequestCachingCountsPastNPeriods()
public double getHitRatioPastNPeriods()
public double getHitCachingRatioPastNPeriods()
public AgeSnapshot getAgeAtEvictionSnapshot()
private static long sum(long[] counts)
private static long[] initializeZeros(int n)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.