public class ClusterAwareHitMissMetricsHolder
extends java.lang.Object
Example of hit-miss metric: loaded or not loaded data, data found in cache or not found.
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
metricName |
protected int |
numberOfHits |
protected int |
numberOfReports |
| Constructor and Description |
|---|
ClusterAwareHitMissMetricsHolder(java.lang.String metricName)
Initialize a metric holder with a metric name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
register(boolean isHit)
Register (notify) a metric holder about event.
|
void |
reportMetrics(Log log)
Report collected metric to a provided logger.
|
protected java.lang.String metricName
protected int numberOfReports
protected int numberOfHits
public ClusterAwareHitMissMetricsHolder(java.lang.String metricName)
metricName - Metric namepublic void register(boolean isHit)
isHit - True if event is a "hit" event.public void reportMetrics(Log log)
log - A logger to report collected metric.