public class TimeStampedMeter extends com.codahale.metrics.Meter implements TimeStampedMetric
Meter class that provides an association of
the Meter value with time stamps.| Constructor and Description |
|---|
TimeStampedMeter(MetricRegistry registry,
MeterDescriptor descriptor)
Constructs a
TimeStampedMeter with the specified characteristics
using the specified MetricRegistry. |
TimeStampedMeter(MetricRegistry registry,
MeterDescriptor descriptor,
String uid)
Constructs a
TimeStampedMeter with the specified UID and other
characteristics using the specified MetricRegistry. |
| Modifier and Type | Method and Description |
|---|---|
MeterDataPoint |
extractDataPoint()
Extract a
MeterDataPoint from this object. |
long |
getCount()
Computes and returns the delta between the current and previous counts,
producing the count for the current time period.
|
MeterDescriptor |
getDescriptor()
Gets the
MetricDescriptor that describes this TimeStampedMetric object. |
long |
getMsSpanned()
Determines the number of milliseconds spanned between the latest (update)
time stamp and the oldest (previous) time stamp, accounting for roll-over
of the time stamp.
|
long |
getPreviousCount()
Gets the previous count for the rolling counter.
|
long |
getPreviousTimeStamp()
Gets the previous time stamp.
|
double |
getRate()
Gets the rate of marked events for the meter.
|
int |
getSlidingWindowMinutes()
Gets the number of minutes spanned by the sliding time window of this
TimeStampedMeter. |
protected TimeStampManager |
getTimeStampManager()
Gets the
TimeStampManager that this object uses to manage its
associated time stamps. |
String |
getUid()
Gets the UID.
|
long |
getUpdateTimeStamp()
Gets the update time stamp.
|
void |
mark(long events) |
void |
reset()
Prepares the meter for use in a new time period.
|
void |
setDescriptor(MeterDescriptor toSet)
Sets the
MeterDescriptor that specifies characteristics of this
TimeStampedMeter. |
void |
setPreviousTimeStamp(long time)
Sets the previous time stamp.
|
void |
setUid(String toSet)
Sets the UID of this object.
|
void |
setUpdateTimeStamp(long time)
Sets the update time stamp.
|
String |
toDebugString()
Gets a detailed representation of this object to facilitate debugging.
|
String |
toString() |
void |
updateTimeStamp()
Convenience method that sets the update time stamp to the current time.
|
public TimeStampedMeter(MetricRegistry registry, MeterDescriptor descriptor)
TimeStampedMeter with the specified characteristics
using the specified MetricRegistry.registry - MetricRegistry to use for allocating this objectdescriptor - MeterDescriptor that specifies various
characteristics of the resulting TimeStampedMeterpublic TimeStampedMeter(MetricRegistry registry, MeterDescriptor descriptor, String uid)
TimeStampedMeter with the specified UID and other
characteristics using the specified MetricRegistry.registry - MetricRegistry to use for allocating this objectdescriptor - MeterDescriptor that specifies various
characteristics of the resulting TimeStampedMeteruid - UID to assign to the resulting TimeStampedMeterIllegalArgumentException - if a null value is supplied for either
the MeterDescriptor or MetricRegistry argumentpublic MeterDataPoint extractDataPoint()
MeterDataPoint from this object.extractDataPoint in interface TimeStampedMetricMeterDataPointpublic long getCount()
getCount in interface com.codahale.metrics.CountinggetCount in interface com.codahale.metrics.MeteredgetCount in class com.codahale.metrics.Meterpublic MeterDescriptor getDescriptor()
TimeStampedMetricMetricDescriptor that describes this TimeStampedMetric object.getDescriptor in interface TimeStampedMetricMetricDescriptor that describes this TimeStampedMetricpublic long getMsSpanned()
TimeStampedMetricgetMsSpanned in interface TimeStampedMetricpublic long getPreviousCount()
public long getPreviousTimeStamp()
TimeStampedMetricgetPreviousTimeStamp in interface TimeStampedMetricpublic double getRate()
TimeStampedMeter.public int getSlidingWindowMinutes()
TimeStampedMeter.protected TimeStampManager getTimeStampManager()
TimeStampManager that this object uses to manage its
associated time stamps.TimeStampManager for this objectpublic String getUid()
TimeStampedMetricgetUid in interface TimeStampedMetricpublic long getUpdateTimeStamp()
TimeStampedMetricgetUpdateTimeStamp in interface TimeStampedMetricpublic void mark(long events)
mark in class com.codahale.metrics.Meterpublic void reset()
reset in interface TimeStampedMetricpublic void setDescriptor(MeterDescriptor toSet)
MeterDescriptor that specifies characteristics of this
TimeStampedMeter.toSet - the MeterDescriptor for this objectpublic void setPreviousTimeStamp(long time)
TimeStampedMetricsetPreviousTimeStamp in interface TimeStampedMetrictime - previous time stamppublic void setUid(String toSet)
TimeStampedMetricsetUid in interface TimeStampedMetrictoSet - new UID for this objectpublic void setUpdateTimeStamp(long time)
TimeStampedMetricsetUpdateTimeStamp in interface TimeStampedMetrictime - update time stamppublic String toDebugString()
public void updateTimeStamp()
TimeStampedMetricupdateTimeStamp in interface TimeStampedMetricCopyright © 2014. All Rights Reserved.