T - value typepublic abstract class AggregatedMetric<T extends Number> extends Object
| Modifier and Type | Field and Description | 
|---|---|
protected long | 
count
Number of values seen 
 | 
protected ValueWithHostname<T> | 
max
Maximum value seen with the host that it came from 
 | 
protected ValueWithHostname<T> | 
min
Minimum value seen with the host that it came from 
 | 
protected T | 
sum
Total of all the values seen 
 | 
| Constructor and Description | 
|---|
AggregatedMetric()  | 
| Modifier and Type | Method and Description | 
|---|---|
abstract void | 
addItem(T value,
       String hostnamePartitionId)
Add another item to the aggregation. 
 | 
long | 
count()
Get number of values seen 
 | 
boolean | 
hasData()
Whether this AggregatedMetric has any data. 
 | 
ValueWithHostname<T> | 
max()
Get maximum value together with host it came from. 
 | 
abstract double | 
mean()
Get average of all the values 
 | 
ValueWithHostname<T> | 
min()
Get minimum value together with host it came from. 
 | 
T | 
sum()
Get total of all the values seen 
 | 
protected ValueWithHostname<T extends Number> min
protected ValueWithHostname<T extends Number> max
protected long count
public abstract void addItem(T value, String hostnamePartitionId)
value - value to addhostnamePartitionId - String hostname it came frompublic boolean hasData()
public ValueWithHostname<T> min()
public ValueWithHostname<T> max()
public T sum()
public abstract double mean()
public long count()
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.