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 . |
boolean |
isValid()
Indicates whether this
TimeStampedMetric 's current value is a
valid one. |
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 TimeStampedHistogram
public 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 TimeStampedHistogram
uid
- UID to assign to the resulting TimeStampedHistogram
IllegalArgumentException
- if a null value is supplied for either
the HistogramDescriptor
or
MetricRegistry
argumentpublic HistogramDataPoint extractDataPoint()
HistogramDataPoint
from this object.extractDataPoint
in interface TimeStampedMetric
HistogramDataPoint
public double get75thPercentile()
TimeStampedHistogram
.public double get95thPercentile()
TimeStampedHistogram
.public double get98thPercentile()
TimeStampedHistogram
.public double get99thPercentile()
TimeStampedHistogram
.public long getCount()
getCount
in interface com.codahale.metrics.Counting
getCount
in class com.codahale.metrics.Histogram
public HistogramDescriptor getDescriptor()
TimeStampedMetric
MetricDescriptor
that describes this TimeStampedMetric
object.getDescriptor
in interface TimeStampedMetric
MetricDescriptor
that describes this TimeStampedMetric
public long getMaximum()
TimeStampedHistogram
.public double getMedian()
TimeStampedHistogram
.public double getMean()
TimeStampedHistogram
.public long getMinimum()
TimeStampedHistogram
.public long getMsSpanned()
TimeStampedMetric
getMsSpanned
in interface TimeStampedMetric
public long getPreviousTimeStamp()
TimeStampedMetric
getPreviousTimeStamp
in interface TimeStampedMetric
public 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()
TimeStampedMetric
getUid
in interface TimeStampedMetric
public long getUpdateTimeStamp()
TimeStampedMetric
getUpdateTimeStamp
in interface TimeStampedMetric
public long[] getValues()
TimeStampedHistogram
.public boolean isValid()
TimeStampedMetric
TimeStampedMetric
's current value is a
valid one. For example, it could be a non-numeric value like Double.NaN,
depending upon type and state of the TimeStampedMetric
.isValid
in interface TimeStampedMetric
true
if valid, false
otherwisepublic void reset()
reset
in interface TimeStampedMetric
public void setDescriptor(HistogramDescriptor toSet)
HistogramDescriptor
that specifies characteristics of
this TimeStampedHistogram
.toSet
- the HistogramDescriptor
for this objectpublic void setPreviousTimeStamp(long time)
TimeStampedMetric
setPreviousTimeStamp
in interface TimeStampedMetric
time
- previous time stamppublic void setUid(String toSet)
TimeStampedMetric
setUid
in interface TimeStampedMetric
toSet
- new UID for this objectpublic void setUpdateTimeStamp(long time)
TimeStampedMetric
setUpdateTimeStamp
in interface TimeStampedMetric
time
- update time stamppublic String toDebugString()
public void update(int toAdd)
update
in class com.codahale.metrics.Histogram
public void update(long toAdd)
update
in class com.codahale.metrics.Histogram
public void updateTimeStamp()
TimeStampedMetric
updateTimeStamp
in interface TimeStampedMetric
Copyright © 2015. All Rights Reserved.