E
- the entity classpublic class MetricSample<E extends Entity> extends Object
Constructor and Description |
---|
MetricSample(E entity) |
Modifier and Type | Method and Description |
---|---|
Map<Short,Double> |
allMetricValues() |
void |
close(long closingTime)
Close this metric sample.
|
E |
entity()
Get the entity this metric sample is corresponding to.
|
boolean |
isValid(MetricDef metricDef)
Validate the metric sample.
|
Double |
metricValue(short metricId)
The metric for the specified metric id.
|
void |
open(long openingTime)
Open this metric sample with a timestamp denoting the timestamp of the oldest metric contained
in this sample.
|
void |
record(MetricInfo info,
double sampleValue)
Record a sample value for the given metric info.
|
long |
sampleCloseTime()
The time upon which the sample was closed.
|
long |
sampleOpenTime()
The time upon which the sample was opened.
|
String |
toString() |
public MetricSample(E entity)
public void record(MetricInfo info, double sampleValue)
info
- The MetricInfo
sampleValue
- the sample value.IllegalStateException
- if the sample is not opened or the metric has been already closedpublic E entity()
public long sampleOpenTime()
public long sampleCloseTime()
public Double metricValue(short metricId)
public void open(long openingTime)
public void close(long closingTime)
public boolean isValid(MetricDef metricDef)