commit | ec343ff62842fb5efa9fdea012030dd7edce5817 | [log] [tgz] |
---|---|---|
author | Jian Li <pyguni@gmail.com> | Tue Feb 02 17:11:13 2016 -0800 |
committer | Gerrit Code Review <gerrit@onlab.us> | Wed Feb 03 02:01:11 2016 +0000 |
tree | cfe2ef01219e7529320b77880b98522788272acc | |
parent | 5e5b3d691609192615a1058d8c165da22d7cd3e4 [diff] |
Implement DefaultControlLoad, add lastUpdate for MetricsDatabase Change-Id: Ice2ba793927117245c3fd12f32da239b60240c90
diff --git a/apps/cpman/api/src/main/java/org/onosproject/cpman/ControlLoad.java b/apps/cpman/api/src/main/java/org/onosproject/cpman/ControlLoad.java index b783aa6..f0c4e63 100644 --- a/apps/cpman/api/src/main/java/org/onosproject/cpman/ControlLoad.java +++ b/apps/cpman/api/src/main/java/org/onosproject/cpman/ControlLoad.java
@@ -39,4 +39,20 @@ * @return average control plane metric value */ long average(); + + /** + * Obtains the most recent metric values of the specified time duration. + * + * @param duration time duration + * @param unit time unit + * @return a collection of the most recent metric values + */ + long[] recent(int duration, TimeUnit unit); + + /** + * Obtains all metrics. + * + * @return a collection of the all metric values + */ + long[] all(); }
diff --git a/apps/cpman/api/src/main/java/org/onosproject/cpman/MetricsDatabase.java b/apps/cpman/api/src/main/java/org/onosproject/cpman/MetricsDatabase.java index a0e3679..da9e2ea 100644 --- a/apps/cpman/api/src/main/java/org/onosproject/cpman/MetricsDatabase.java +++ b/apps/cpman/api/src/main/java/org/onosproject/cpman/MetricsDatabase.java
@@ -117,6 +117,14 @@ double[] metrics(String metricType, long startTime, long endTime); /** + * Returns the latest metric update time. + * + * @param metricType metric type + * @return timestamp + */ + long lastUpdate(String metricType); + + /** * A builder of MetricsDatabase. */ interface Builder {