public interface MetricsDatabase
| Modifier and Type | Interface and Description |
|---|---|
static interface |
MetricsDatabase.Builder
A builder of MetricsDatabase.
|
| Modifier and Type | Method and Description |
|---|---|
long |
lastUpdate(java.lang.String metricType)
Returns the latest metric update time.
|
double |
maxMetric(java.lang.String metricType)
Returns maximum metric value of a given metric type.
|
java.lang.String |
metricName()
Returns the metric name of this database.
|
double[] |
metrics(java.lang.String metricType)
Returns a collection of metric values of a given metric type for a day.
|
double[] |
metrics(java.lang.String metricType,
long startTime,
long endTime)
Returns a collection of metric values of a given metric type for
a given period.
|
double |
minMetric(java.lang.String metricType)
Returns minimum metric value of a given metric type.
|
double |
recentMetric(java.lang.String metricType)
Returns most recent metric value of a given metric type.
|
double[] |
recentMetrics(java.lang.String metricType,
int duration,
java.util.concurrent.TimeUnit unit)
Return most recent metric values of a given metric type for a given period.
|
java.lang.String |
resourceName()
Returns the resource name of this database.
|
void |
updateMetric(java.lang.String metricType,
double value)
Update metric value by specifying metric type.
|
void |
updateMetric(java.lang.String metricType,
double value,
long time)
Update metric value by specifying metric type in a certain time.
|
void |
updateMetrics(java.util.Map<java.lang.String,java.lang.Double> metrics)
Update metric values of a collection of metric types.
|
void |
updateMetrics(java.util.Map<java.lang.String,java.lang.Double> metrics,
long time)
Update metric values of a collection of metric types.
|
java.lang.String metricName()
java.lang.String resourceName()
void updateMetric(java.lang.String metricType,
double value)
metricType - metric type (e.g., load, usage, etc.)value - metric valuevoid updateMetric(java.lang.String metricType,
double value,
long time)
metricType - metric type (e.g., load, usage, etc.)value - metric valuetime - update time in secondsvoid updateMetrics(java.util.Map<java.lang.String,java.lang.Double> metrics,
long time)
metrics - a collection of metrics which consists of a pair of
metric type and metric valuetime - update time in secondsvoid updateMetrics(java.util.Map<java.lang.String,java.lang.Double> metrics)
metrics - a collection of metrics which consists of a pair of
metric type and metric valuedouble recentMetric(java.lang.String metricType)
metricType - metric typedouble[] recentMetrics(java.lang.String metricType,
int duration,
java.util.concurrent.TimeUnit unit)
metricType - metric typeduration - durationunit - time unitdouble minMetric(java.lang.String metricType)
metricType - metric typedouble maxMetric(java.lang.String metricType)
metricType - metric typedouble[] metrics(java.lang.String metricType)
metricType - metric typedouble[] metrics(java.lang.String metricType,
long startTime,
long endTime)
metricType - metric typestartTime - start timeendTime - end timelong lastUpdate(java.lang.String metricType)
metricType - metric type