Added the data store benchmark (dsbenchmark, Bug 4519, https://bugs.opendaylight...
[controller.git] / benchmark / api / src / main / yang / dsbenchmark.yang
1 module dsbenchmark {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:dsbenchmark";
4     prefix "dsbenchmark";
5
6     revision "2015-01-05" {
7         description "Initial revision of dsbenchmark model";
8     }
9     container test-exec {
10         config true;
11
12         list outer-list {
13             key id;
14             leaf id {
15                 type int32;
16             }
17             choice outer-choice {
18                 case one {
19                     leaf one {
20                         type string;
21                     }
22                 }
23                 case two-three {
24                     leaf two {
25                         type string;
26                     }
27                     leaf three {
28                         type string;
29                     }
30                }
31            }
32            list inner-list {
33                 key name;
34                 leaf name {
35                     type int32;
36                 }
37                 leaf value {
38                     type string;
39                 }
40             }
41         }
42     }
43
44     container test-status {
45         leaf execStatus {
46             type enumeration {
47                 enum "idle" {
48                     value 1;
49                 }
50                 enum "executing" {
51                     value 2;
52                 }
53             }
54             config false;
55             mandatory true;
56             description
57                 "Indicates whether a test run is in progress; only one test can run at a time";
58         }
59         leaf testsCompleted {
60             type uint32;
61             default 1;
62             description
63                 "Number of completed test runs";
64           }
65     }
66
67     rpc start-test {
68         description
69           "Start a new data store write test run";
70
71         input {
72             leaf operation {
73                 mandatory true;
74                 type enumeration {
75                     enum "PUT" {
76                         value 1;
77                         description
78                           "The put operation";
79                     }
80                     enum "MERGE" {
81                         value 2;
82                         description
83                           "The merge operation";
84                     }
85                     enum "DELETE" {
86                         value 3;
87                         description
88                             "Delete items from a list sotred in the data store";
89                     }
90                     enum "READ" {
91                         value 4;
92                         description
93                         "The read operation";
94                     }
95                 }
96                 description
97                     "Type of the transaction operation to benchmark";
98             }
99
100             leaf data-format {
101                 mandatory true;
102                 type enumeration {
103                     enum "BINDING-AWARE" {
104                         value 1;
105                     }
106                     enum "BINDING-INDEPENDENT" {
107                         value 2;
108                     }
109                 }
110                 description
111                     "Data format:-binding-aware or binding-independent";
112             }
113
114             leaf transaction-type {
115                 mandatory true;
116                 type enumeration {
117                     enum "SIMPLE-TX" {
118                         value 1;
119                     }
120                     enum "TX-CHAINING" {
121                         value 2;
122                     }
123                 }
124                 description
125                     "Data format:-binding-aware or binding-independent";
126             }
127
128             leaf outerElements {
129                 type uint32;
130                 default 100000;
131                 description
132                   "Number of elements in the OuterList";
133               }
134             leaf innerElements {
135                 type uint32;
136                 default 1;
137                 description
138                   "Number of elements in the InnerList";
139               }
140             leaf putsPerTx {
141                 type uint32;
142                 default 1;
143                 description
144                   "Number of write operations (PUT, MERGE, or DELETE) per transaction submit";
145               }
146         }
147         output {
148             leaf status {
149                 mandatory true;
150                 type enumeration {
151                     enum "OK" {
152                         value 1;
153                     }
154                     enum "FAILED" {
155                         value 2;
156                     }
157                     enum "TEST-IN-PROGRESS" {
158                         value 3;
159                     }
160                 }
161                 description
162                     "Indicates whether the test finished successfuly";
163                }
164             leaf listBuildTime {
165                 type uint32;
166                 default 1;
167                 description
168                   "The time it took to build the list of lists";
169               }
170             leaf execTime {
171                 type uint32;
172                 default 1;
173                 description
174                   "The time it took to execute all transactions";
175               }
176             leaf txOk {
177                 type uint32;
178                 default 1;
179                 description
180                   "The number of successful transactions";
181               }
182             leaf txError {
183                 type uint32;
184                 default 1;
185                 description
186                   "The number of failed transactions";
187               }
188
189         }
190     }
191
192     rpc cleanup-store {
193         description
194           "Delete data in the test-exec container that may have been left behind from a previous test run";
195     }
196 }