Package org.onlab.metrics
Class EventMetric
- java.lang.Object
-
- org.onlab.metrics.EventMetric
-
public class EventMetric extends java.lang.Object
Metric measurements for events.
-
-
Constructor Summary
Constructors Constructor Description EventMetric(MetricsService metricsService, java.lang.String componentName, java.lang.String featureName)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.codahale.metrics.Meter
eventRateMeter()
Gets the event rate meter.void
eventReceived()
Updates the metric measurements for a single event.com.codahale.metrics.Gauge<java.lang.Long>
lastEventTimestampGauge()
Gets the last event timestamp Gauge (ms from the Epoch).void
registerMetrics()
Registers the metrics.void
removeMetrics()
Removes the metrics.
-
-
-
Constructor Detail
-
EventMetric
public EventMetric(MetricsService metricsService, java.lang.String componentName, java.lang.String featureName)
Constructor.- Parameters:
metricsService
- the Metrics Service to use for Metrics registration and deregistrationcomponentName
- the Metrics Component Name to use for Metrics registration and deregistrationfeatureName
- the Metrics Feature Name to use for Metrics registration and deregistration
-
-
Method Detail
-
registerMetrics
public void registerMetrics()
Registers the metrics.
-
removeMetrics
public void removeMetrics()
Removes the metrics.
-
eventReceived
public void eventReceived()
Updates the metric measurements for a single event.
-
lastEventTimestampGauge
public com.codahale.metrics.Gauge<java.lang.Long> lastEventTimestampGauge()
Gets the last event timestamp Gauge (ms from the Epoch).- Returns:
- the last event timestamp Gauge (ms from the Epoch)
-
eventRateMeter
public com.codahale.metrics.Meter eventRateMeter()
Gets the event rate meter.- Returns:
- the event rate meter
-
-