G
- The aggregation group class of the entity.E
- the entity classpublic class MetricSample<G,E extends Entity<G>> extends Object
Modifier and Type | Field and Description |
---|---|
protected E |
entity |
protected long |
sampleTime |
protected Map<Short,Double> |
valuesByMetricId |
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.
|
protected MetricDef |
metricDefForToString()
A method that can be overridden by subclasses to get prettier toString() format.
|
Double |
metricValue(short metricId)
The metric for the specified metric id.
|
void |
record(MetricInfo info,
double sampleValue)
Record a sample value for the given metric info.
|
long |
sampleTime()
The time this sample was taken.
|
String |
toString() |
public MetricSample(E entity)
public void record(MetricInfo info, double sampleValue)
info
- The MetricInfo
sampleValue
- the sample value.public E entity()
public long sampleTime()
public Double metricValue(short metricId)
public void close(long closingTime)
protected MetricDef metricDefForToString()
MetricDef
used for toString() method.public boolean isValid(MetricDef metricDef)