Package org.onosproject.cpman
Interface MetricsDatabase
- 
public interface MetricsDatabaseDatabase for storing a metric. 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceMetricsDatabase.BuilderA builder of MetricsDatabase. 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longlastUpdate(String metricType)Returns the latest metric update time.doublemaxMetric(String metricType)Returns maximum metric value of a given metric type.StringmetricName()Returns the metric name of this database.double[]metrics(String metricType)Returns a collection of metric values of a given metric type for a day.double[]metrics(String metricType, long startTime, long endTime)Returns a collection of metric values of a given metric type for a given period.doubleminMetric(String metricType)Returns minimum metric value of a given metric type.doublerecentMetric(String metricType)Returns most recent metric value of a given metric type.double[]recentMetrics(String metricType, int duration, TimeUnit unit)Return most recent metric values of a given metric type for a given period.StringresourceName()Returns the resource name of this database.voidupdateMetric(String metricType, double value)Update metric value by specifying metric type.voidupdateMetric(String metricType, double value, long time)Update metric value by specifying metric type in a certain time.voidupdateMetrics(Map<String,Double> metrics)Update metric values of a collection of metric types.voidupdateMetrics(Map<String,Double> metrics, long time)Update metric values of a collection of metric types. 
 - 
 
- 
- 
Method Detail
- 
metricName
String metricName()
Returns the metric name of this database.- Returns:
 - metric name
 
 
- 
resourceName
String resourceName()
Returns the resource name of this database.- Returns:
 - resource name
 
 
- 
updateMetric
void updateMetric(String metricType, double value)
Update metric value by specifying metric type.- Parameters:
 metricType- metric type (e.g., load, usage, etc.)value- metric value
 
- 
updateMetric
void updateMetric(String metricType, double value, long time)
Update metric value by specifying metric type in a certain time.- Parameters:
 metricType- metric type (e.g., load, usage, etc.)value- metric valuetime- update time in seconds
 
- 
updateMetrics
void updateMetrics(Map<String,Double> metrics, long time)
Update metric values of a collection of metric types.- Parameters:
 metrics- a collection of metrics which consists of a pair of metric type and metric valuetime- update time in seconds
 
- 
updateMetrics
void updateMetrics(Map<String,Double> metrics)
Update metric values of a collection of metric types.- Parameters:
 metrics- a collection of metrics which consists of a pair of metric type and metric value
 
- 
recentMetric
double recentMetric(String metricType)
Returns most recent metric value of a given metric type.- Parameters:
 metricType- metric type- Returns:
 - metric value
 
 
- 
recentMetrics
double[] recentMetrics(String metricType, int duration, TimeUnit unit)
Return most recent metric values of a given metric type for a given period.- Parameters:
 metricType- metric typeduration- durationunit- time unit- Returns:
 - a collection of metric value
 
 
- 
minMetric
double minMetric(String metricType)
Returns minimum metric value of a given metric type.- Parameters:
 metricType- metric type- Returns:
 - metric value
 
 
- 
maxMetric
double maxMetric(String metricType)
Returns maximum metric value of a given metric type.- Parameters:
 metricType- metric type- Returns:
 - metric value
 
 
- 
metrics
double[] metrics(String metricType)
Returns a collection of metric values of a given metric type for a day.- Parameters:
 metricType- metric type- Returns:
 - a collection of metric value
 
 
- 
metrics
double[] metrics(String metricType, long startTime, long endTime)
Returns a collection of metric values of a given metric type for a given period.- Parameters:
 metricType- metric typestartTime- start timeendTime- end time- Returns:
 - a collection of metric value
 
 
- 
lastUpdate
long lastUpdate(String metricType)
Returns the latest metric update time.- Parameters:
 metricType- metric type- Returns:
 - timestamp
 
 
 - 
 
 -