Package co.elastic.apm.agent.metrics
Class MetricSet
- java.lang.Object
-
- co.elastic.apm.agent.metrics.MetricSet
-
- All Implemented Interfaces:
Recyclable
public class MetricSet extends java.lang.Object implements Recyclable
A metric set is a collection of metrics which have the same labels.A metric set corresponds to one document per
Example of some serialized metric sets:metrics_intervalin Elasticsearch. An alternative would be to have one document per metric but having one document for all metrics with the same labels saves disk space.{"metricset":{"timestamp":1545047730692000,"samples":{"jvm.gc.alloc":{"value":24089200.0}}}} {"metricset":{"timestamp":1545047730692000,"tags":{"name":"G1 Young Generation"},"samples":{"jvm.gc.time":{"value":0.0},"jvm.gc.count":{"value":0.0}}}} {"metricset":{"timestamp":1545047730692000,"tags":{"name":"G1 Old Generation"}, "samples":{"jvm.gc.time":{"value":0.0},"jvm.gc.count":{"value":0.0}}}}
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.util.concurrent.atomic.AtomicLong>getCounters()java.util.concurrent.ConcurrentMap<java.lang.String,DoubleSupplier>getGauges()LabelsgetLabels()java.util.Map<java.lang.String,Timer>getTimers()booleanhasContent()voidincrementCounter(java.lang.String name)voidresetState()Should be called only when the MetricSet is inactiveTimertimer(java.lang.String timerName)
-
-
-
Method Detail
-
getLabels
public Labels getLabels()
-
getGauges
public java.util.concurrent.ConcurrentMap<java.lang.String,DoubleSupplier> getGauges()
-
timer
public Timer timer(java.lang.String timerName)
-
incrementCounter
public void incrementCounter(java.lang.String name)
-
getTimers
public java.util.Map<java.lang.String,Timer> getTimers()
-
hasContent
public boolean hasContent()
-
resetState
public void resetState()
Should be called only when the MetricSet is inactive- Specified by:
resetStatein interfaceRecyclable
-
getCounters
public java.util.Map<java.lang.String,java.util.concurrent.atomic.AtomicLong> getCounters()
-
-