Model dom-broker statistics 20/13120/6
authorRobert Varga <rovarga@cisco.com>
Tue, 25 Nov 2014 11:39:53 +0000 (12:39 +0100)
committerRobert Varga <rovarga@cisco.com>
Wed, 24 Dec 2014 12:54:07 +0000 (13:54 +0100)
This adds a model of statistics, reusing proper types where possible.

Change-Id: Iae5004df1eee6b2989cab5894173a38ccc96f1bc
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/yang/odl-sal-cds-cfg.yang
opendaylight/md-sal/sal-dom-broker/pom.xml
opendaylight/md-sal/sal-dom-broker/src/main/yang/opendaylight-dom-broker-impl.yang

index 2abe89316b18a600e9510beef41a54ae29c05321..325dad33d78d36ce6a8938c15459de6b1e0d9850 100644 (file)
@@ -8,6 +8,7 @@ module odl-concurrent-data-broker-cfg {
     import opendaylight-operational-dom-datastore {prefix operational-dom-store-spi;}
     import opendaylight-md-sal-dom {prefix sal; }
     import opendaylight-sal-dom-broker-impl { prefix broker; }
     import opendaylight-operational-dom-datastore {prefix operational-dom-store-spi;}
     import opendaylight-md-sal-dom {prefix sal; }
     import opendaylight-sal-dom-broker-impl { prefix broker; }
+    import rpc-context { prefix rpcx; revision-date 2013-06-17; }
 
     description
         "Service definition for concurrent dom broker.";
 
     description
         "Service definition for concurrent dom broker.";
@@ -29,4 +30,12 @@ module odl-concurrent-data-broker-cfg {
             uses broker:dom-broker-config;
         }
     }
             uses broker:dom-broker-config;
         }
     }
+
+    augment "/config:modules/config:module/config:state" {
+        case dom-concurrent-data-broker {
+            when "/config:modules/config:module/config:type = 'dom-concurrent-data-broker'";
+
+            uses broker:dom-broker-operational;
+        }
+    }
 }
 }
index aec7efe46cd67c642c9614a31c67b2243d36b056..a824792cf84d5fb530198ea00bd5e326faed0a49 100644 (file)
       <artifactId>yang-parser-impl</artifactId>
     </dependency>
 
       <artifactId>yang-parser-impl</artifactId>
     </dependency>
 
+    <dependency>
+        <groupId>org.opendaylight.yangtools.model</groupId>
+        <artifactId>ietf-yang-types</artifactId>
+    </dependency>
+
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
index 1a553eab52b6c320f30cfb89034bedadb442514f..989b5b56499c075db324187cb3024be43b5b7f53 100644 (file)
@@ -1,13 +1,15 @@
 module opendaylight-sal-dom-broker-impl {
     yang-version 1;
     namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl";
 module opendaylight-sal-dom-broker-impl {
     yang-version 1;
     namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl";
-    prefix "binding-impl";
+    prefix "broker";
 
     import config { prefix config; revision-date 2013-04-05; }
 
     import config { prefix config; revision-date 2013-04-05; }
+    import ietf-yang-types { prefix yang; }
     import opendaylight-md-sal-dom {prefix sal;}
     import opendaylight-md-sal-common {prefix common;}
     import opendaylight-config-dom-datastore {prefix config-dom-store-spi;}
     import opendaylight-operational-dom-datastore {prefix operational-dom-store-spi;}
     import opendaylight-md-sal-dom {prefix sal;}
     import opendaylight-md-sal-common {prefix common;}
     import opendaylight-config-dom-datastore {prefix config-dom-store-spi;}
     import opendaylight-operational-dom-datastore {prefix operational-dom-store-spi;}
+    import rpc-context { prefix rpcx; revision-date 2013-06-17; }
 
     description
         "Service definition for Binding Aware MD-SAL.
 
     description
         "Service definition for Binding Aware MD-SAL.
@@ -117,6 +119,52 @@ module opendaylight-sal-dom-broker-impl {
         }
     }
 
         }
     }
 
+    grouping dom-broker-operational {
+        leaf total-commits {
+            type uint64;
+        }
+
+        leaf average-commit {
+            type uint64;
+            units ns;
+        }
+
+        leaf longest-commit-duration {
+            type uint64;
+            units ns;
+        }
+
+        leaf longest-commit-timestamp {
+            type yang:date-and-time;
+        }
+
+        leaf shortest-commit-duration {
+            type uint64;
+            units ns;
+        }
+
+        leaf shortest-commit-timestamp {
+            type yang:date-and-time;
+        }
+
+        rpcx:rpc-context-instance dom-broker-rpc-ctx;
+    }
+
+    identity dom-broker-rpc-ctx;
+
+    rpc reset-statistics {
+        description
+          "JMX call to clear the toasts-made counter.";
+
+        input {
+            uses rpcx:rpc-context-ref {
+                refine context-instance {
+                    rpcx:rpc-context-instance dom-broker-rpc-ctx;
+                }
+            }
+        }
+    }
+
     augment "/config:modules/config:module/config:configuration" {
         case dom-inmemory-data-broker {
             when "/config:modules/config:module/config:type = 'dom-inmemory-data-broker'";
     augment "/config:modules/config:module/config:configuration" {
         case dom-inmemory-data-broker {
             when "/config:modules/config:module/config:type = 'dom-inmemory-data-broker'";
@@ -125,6 +173,14 @@ module opendaylight-sal-dom-broker-impl {
         }
     }
 
         }
     }
 
+    augment "/config:modules/config:module/config:state" {
+        case dom-inmemory-data-broker {
+            when "/config:modules/config:module/config:type = 'dom-inmemory-data-broker'";
+
+            uses dom-broker-operational;
+        }
+    }
+
     augment "/config:modules/config:module/config:state" {
         case schema-service-singleton {
             when "/config:modules/config:module/config:type = 'schema-service-singleton'";
     augment "/config:modules/config:module/config:state" {
         case schema-service-singleton {
             when "/config:modules/config:module/config:type = 'schema-service-singleton'";