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 {