public class TimeStampedHistogram extends com.codahale.metrics.Histogram implements TimeStampedMetric
Histogram class that provides an association
of sliding time window Histogram values with time stamps.| Constructor and Description |
|---|
TimeStampedHistogram(MetricRegistry registry,
HistogramDescriptor descriptor)
Constructs a
TimeStampedHistogram with the specified
characteristics using the specified MetricRegistry. |
TimeStampedHistogram(MetricRegistry registry,
HistogramDescriptor descriptor,
String uid)
Constructs a
TimeStampedHistogram with the specified UID and
other characteristics using the specified MetricRegistry. |
| Modifier and Type | Method and Description |
|---|---|
HistogramDataPoint |
extractDataPoint()
Extract a
HistogramDataPoint from this object. |
double |
get75thPercentile()
Gets the value at the 75th percentile of all values currently encompassed
within the the sliding time window of this
TimeStampedHistogram. |
double |
get95thPercentile()
Gets the value at the 95th percentile of all values currently encompassed
within the the sliding time window of this
TimeStampedHistogram. |
double |
get98thPercentile()
Gets the value at the 98th percentile of all values currently encompassed
within the the sliding time window of this
TimeStampedHistogram. |
double |
get99thPercentile()
Gets the value at the 99th percentile of all values currently encompassed
within the the sliding time window of this
TimeStampedHistogram. |
long |
getCount() |
HistogramDescriptor |
getDescriptor()
Gets the
MetricDescriptor that describes this TimeStampedMetric object. |
long |
getMaximum()
Gets the maximum of all values currently encompassed within the sliding
time window of this
TimeStampedHistogram. |
double |
getMean()
Gets the mean of the values currently encompassed within the sliding time
window of this
TimeStampedHistogram. |
double |
getMedian()
Gets the median of all values currently encompassed within the sliding
time window of this
TimeStampedHistogram. |
long |
getMinimum()
Gets the minimum of all values currently encompassed within the sliding
time window of this
TimeStampedHistogram. |
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 |
getPreviousTimeStamp()
Gets the previous time stamp.
|
int |
getSlidingWindowMinutes()
Gets the number of minutes spanned by the sliding time window of this
TimeStampedHistogram. |
double |
getStandardDeviation()
Gets the standard deviation of the values currently encompassed within
the sliding time window of this
TimeStampedHistogram. |
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.
|
long[] |
getValues()
Gets the actual values currently encompassed within the sliding time
window of this
TimeStampedHistogram. |
void |
reset()
Prepares the histogram for use in a new time period.
|
void |
setDescriptor(HistogramDescriptor toSet)
Sets the
HistogramDescriptor that specifies characteristics of
this TimeStampedHistogram. |
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 |
update(int toAdd) |
void |
update(long toAdd) |
void |
updateTimeStamp()
Convenience method that sets the update time stamp to the current time.
|
public TimeStampedHistogram(MetricRegistry registry, HistogramDescriptor descriptor)
TimeStampedHistogram with the specified
characteristics using the specified MetricRegistry.registry - MetricRegistry to use for allocating this objectdescriptor - HistogramDescriptor that specifies various
characteristics of the resulting TimeStampedHistogrampublic TimeStampedHistogram(MetricRegistry registry, HistogramDescriptor descriptor, String uid)
TimeStampedHistogram with the specified UID and
other characteristics using the specified MetricRegistry.registry - MetricRegistry to use for allocating this objectdescriptor - HistogramDescriptor that specifies various
characteristics of the resulting TimeStampedHistogramuid - UID to assign to the resulting TimeStampedHistogramIllegalArgumentException - if a null value is supplied for either
the HistogramDescriptor or
MetricRegistry argumentpublic HistogramDataPoint extractDataPoint()
HistogramDataPoint from this object.extractDataPoint in interface TimeStampedMetricHistogramDataPointpublic double get75thPercentile()
TimeStampedHistogram.public double get95thPercentile()
TimeStampedHistogram.public double get98thPercentile()
TimeStampedHistogram.public double get99thPercentile()
TimeStampedHistogram.public long getCount()
getCount in interface com.codahale.metrics.CountinggetCount in class com.codahale.metrics.Histogrampublic HistogramDescriptor getDescriptor()
TimeStampedMetricMetricDescriptor that describes this TimeStampedMetric object.getDescriptor in interface TimeStampedMetricMetricDescriptor that describes this TimeStampedMetricpublic long getMaximum()
TimeStampedHistogram.public double getMedian()
TimeStampedHistogram.public double getMean()
TimeStampedHistogram.public long getMinimum()
TimeStampedHistogram.public long getMsSpanned()
TimeStampedMetricgetMsSpanned in interface TimeStampedMetricpublic long getPreviousTimeStamp()
TimeStampedMetricgetPreviousTimeStamp in interface TimeStampedMetricpublic int getSlidingWindowMinutes()
TimeStampedHistogram.public double getStandardDeviation()
TimeStampedHistogram.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 long[] getValues()
TimeStampedHistogram.public void reset()
reset in interface TimeStampedMetricpublic void setDescriptor(HistogramDescriptor toSet)
HistogramDescriptor that specifies characteristics of
this TimeStampedHistogram.toSet - the HistogramDescriptor 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 update(int toAdd)
update in class com.codahale.metrics.Histogrampublic void update(long toAdd)
update in class com.codahale.metrics.Histogrampublic void updateTimeStamp()
TimeStampedMetricupdateTimeStamp in interface TimeStampedMetricCopyright © 2014. All Rights Reserved.