Bump versions to 0.21.8-SNAPSHOT
[bgpcep.git] / docs / pcep / pcep-user-guide-session-statistics.rst
1 .. _pcep-user-guide-session-statistics:
2
3 Session statistics
4 ==================
5 The PCEP statistics provides information about PCE <-> PCC session and its stateful listener (topology-provider).
6
7 Usage
8 '''''
9
10 **URL:** ``/rests/data/network-topology:network-topology/topology=pcep-topology/node=pcc%3A%2F%2F43.43.43.43/pcep-session-state?content=nonconfig``
11
12 **Method:** ``GET``
13
14 .. tabs::
15
16    .. tab:: XML
17
18       **Response Body:**
19
20       .. code-block:: xml
21          :linenos:
22          :emphasize-lines: 3,4,5,6,7,8,9,10,12,13,14,15,24,25,26,27,30,31,32,33,36,37,38,40,41,42
23
24          <pcep-session-state xmlns="urn:opendaylight:params:xml:ns:yang:topology:pcep:stats">
25             <messages>
26                <last-received-rpt-msg-timestamp xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">1512640592</last-received-rpt-msg-timestamp>
27                <sent-upd-msg-count xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">0</sent-upd-msg-count>
28                <received-rpt-msg-count xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">2</received-rpt-msg-count>
29                <sent-init-msg-count xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">0</sent-init-msg-count>
30                <sent-msg-count>0</sent-msg-count>
31                <last-sent-msg-timestamp>0</last-sent-msg-timestamp>
32                <unknown-msg-received>0</unknown-msg-received>
33                <received-msg-count>2</received-msg-count>
34                <error-messages>
35                   <last-sent-error></last-sent-error>
36                   <received-error-msg-count>0</received-error-msg-count>
37                   <sent-error-msg-count>0</sent-error-msg-count>
38                   <last-received-error></last-received-error>
39                </error-messages>
40                <reply-time>
41                   <average-time>0</average-time>
42                   <min-time>0</min-time>
43                   <max-time>0</max-time>
44                </reply-time>
45             </messages>
46             <peer-pref>
47                <keepalive>30</keepalive>
48                <deadtimer>120</deadtimer>
49                <ip-address>127.0.0.1</ip-address>
50                <session-id>0</session-id>
51             </peer-pref>
52             <local-pref>
53                <keepalive>30</keepalive>
54                <deadtimer>120</deadtimer>
55                <ip-address>127.0.0.1</ip-address>
56                <session-id>0</session-id>
57             </local-pref>
58             <peer-capabilities>
59                <stateful xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">true</stateful>
60                <instantiation xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">true</instantiation>
61                <active xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">true</active>
62             </peer-capabilities>
63             <session-duration>0:00:00:18</session-duration>
64             <delegated-lsps-count>1</delegated-lsps-count>
65             <synchronized>true</synchronized>
66          </pcep-session-state>
67
68       @line 3: **last-received-rpt-msg-timestamp** - The timestamp of last received PCRpt message.
69
70       @line 4: **sent-upd-msg-count** - The number of sent PCUpd messages.
71
72       @line 5: **received-rpt-msg-count** - The number of received PcRpt messages.
73
74       @line 6: **sent-init-msg-count** - The number of sent PCInitiate messages.
75
76       @line 7: **sent-msg-count** - Total number of sent PCEP messages.
77
78       @line 8: **last-sent-msg-timestamp** - The timestamp of last sent message.
79
80       @line 9: **unknown-msg-received** - The number of received unknown messages.
81
82       @line 10: **received-msg-count** - Total number of received PCEP messages.
83
84       @line 12: **last-sent-error** - Type/value tuple of last sent error.
85
86       @line 13: **received-error-msg-count** - Total number of received PCErr messages.
87
88       @line 14: **sent-error-msg-count** - Total number of sent PCErr messages.
89
90       @line 15: **last-received-error** - Type/value tuple of last sent error.
91
92       @line 24: **keepalive** - Advertised keep-alive value.
93
94       @line 25: **deadtimer** - Advertised deadtimer value.
95
96       @line 26: **ip-address** - Peer's IP address.
97
98       @line 27: **session-id** - Peer's session identifier.
99
100       @line 30: **keepalive** - Advertised keep-alive value.
101
102       @line 31: **deadtimer** - Advertised deadtimer value.
103
104       @line 32: **ip-address** - Peer's IP address.
105
106       @line 33: **session-id** - Peer's session identifier.
107
108       @line 35: **stateful** - Represents peer's stateful/stateless capability.
109
110       @line 36: **instantiation** - Represents peer's instantiation capability.
111
112       @line 37: **active** - Represents peer's LSP update capability.
113
114       @line 40: **session-duration** - Elapsed time (in d:H:m:s) from session-up until last statistic update.
115
116       @line 41: **delegated-lsps-count** - The number of delegated LSPs (tunnels) from PCC.
117
118       @line 42: **synchronized** - Represents synchronization status.
119
120    .. tab:: JSON
121
122       **Response Body:**
123
124       .. code-block:: json
125          :linenos:
126          :emphasize-lines: 4,5,6,7,8,9,10,11,13,14,15,16,25,26,27,28,31,32,33,34,37,38,39,41,42,43
127
128          {
129              "pcep-session-state": {
130                  "messages": {
131                      "last-received-rpt-msg-timestamp": 1512640592,
132                      "sent-upd-msg-count": 0,
133                      "received-rpt-msg-count": 2,
134                      "sent-init-msg-count": 0,
135                      "sent-msg-count": 0,
136                      "last-sent-msg-timestamp": 0,
137                      "unknown-msg-received": 0,
138                      "received-msg-count": 2,
139                      "error-messages": {
140                          "last-sent-error": null,
141                          "received-error-msg-count": 0,
142                          "sent-error-msg-count": 0,
143                          "last-received-error": null
144                      },
145                      "reply-time": {
146                          "average-time": 0,
147                          "min-time": 0,
148                          "max-time": 0
149                      }
150                  },
151                  "peer-pref": {
152                      "keepalive": 30,
153                      "deadtimer": 120,
154                      "ip-address": "127.0.0.1",
155                      "session-id": 0
156                  },
157                  "local-pref": {
158                      "keepalive": 30,
159                      "deadtimer": 120,
160                      "ip-address": "127.0.0.1",
161                      "session-id": 0
162                  },
163                  "peer-capabilities": {
164                      "stateful": true,
165                      "instantiation": true,
166                      "active": true
167                  },
168                  "session-duration": "0:00:00:18",
169                  "delegated-lsps-count": 1,
170                  "synchronized": true
171              }
172          }
173
174       @line 4: **last-received-rpt-msg-timestamp** - The timestamp of last received PCRpt message.
175
176       @line 5: **sent-upd-msg-count** - The number of sent PCUpd messages.
177
178       @line 6: **received-rpt-msg-count** - The number of received PcRpt messages.
179
180       @line 7: **sent-init-msg-count** - The number of sent PCInitiate messages.
181
182       @line 8: **sent-msg-count** - Total number of sent PCEP messages.
183
184       @line 9: **last-sent-msg-timestamp** - The timestamp of last sent message.
185
186       @line 10: **unknown-msg-received** - The number of received unknown messages.
187
188       @line 11: **received-msg-count** - Total number of received PCEP messages.
189
190       @line 13: **last-sent-error** - Type/value tuple of last sent error.
191
192       @line 14: **received-error-msg-count** - Total number of received PCErr messages.
193
194       @line 15: **sent-error-msg-count** - Total number of sent PCErr messages.
195
196       @line 16: **last-received-error** - Type/value tuple of last sent error.
197
198       @line 25: **keepalive** - Advertised keep-alive value.
199
200       @line 26: **deadtimer** - Advertised deadtimer value.
201
202       @line 27: **ip-address** - Peer's IP address.
203
204       @line 28: **session-id** - Peer's session identifier.
205
206       @line 31: **keepalive** - Advertised keep-alive value.
207
208       @line 32: **deadtimer** - Advertised deadtimer value.
209
210       @line 33: **ip-address** - Peer's IP address.
211
212       @line 34: **session-id** - Peer's session identifier.
213
214       @line 37: **stateful** - Represents peer's stateful/stateless capability.
215
216       @line 38: **instantiation** - Represents peer's instantiation capability.
217
218       @line 39: **active** - Represents peer's LSP update capability.
219
220       @line 41: **session-duration** - Elapsed time (in d:H:m:s) from session-up until last statistic update.
221
222       @line 42: **delegated-lsps-count** - The number of delegated LSPs (tunnels) from PCC.
223
224       @line 43: **synchronized** - Represents synchronization status.
225
226 Following RPC can be used to fetch PCEP session statistics. If PCEP topology and/or PCC node is not specified in input,
227 statistics for all PCEP sessions under the context are returned.
228
229 Usage
230 '''''
231
232 **URL:** ``/rests/operations/pcep-topology-stats-rpc:get-stats``
233
234 **Method:** ``POST``
235
236 .. tabs::
237
238    .. tab:: XML
239
240       **Content-Type:** ``application/xml``
241
242       **Request Body:**
243
244       .. code-block:: xml
245
246          <input xmlns="urn:opendaylight:params:xml:ns:yang:pcep:topology:stats:rpc">
247             <topology>
248                <topology-id>pcep-topology</topology-id>
249                <node>
250                   <node-id>pcc://43.43.43.43</node-id>
251                </node>
252             </topology>
253          </input>
254
255       **Response Body:**
256
257       .. code-block:: xml
258
259          <output xmlns="urn:opendaylight:params:xml:ns:yang:pcep:topology:stats:rpc">
260             <topology>
261                <topology-id>pcep-topology</topology-id>
262                <node>
263                   <node-id>pcc://43.43.43.43</node-id>
264                   <pcep-session-state>
265                      <synchronized>true</synchronized>
266                      <peer-capabilities>
267                         <stateful xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">true</stateful>
268                         <instantiation xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">true</instantiation>
269                         <active xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">true</active>
270                      </peer-capabilities>
271                      <local-pref>
272                         <keepalive>30</keepalive>
273                         <deadtimer>120</deadtimer>
274                         <session-id>1</session-id>
275                         <ip-address>127.0.0.1</ip-address>
276                      </local-pref>
277                      <session-duration>4:01:59:46</session-duration>
278                      <messages>
279                         <unknown-msg-received>0</unknown-msg-received>
280                         <received-msg-count>11752</received-msg-count>
281                         <error-messages>
282                            <last-sent-error>
283                               <error-type>0</error-type>
284                               <error-value>0</error-value>
285                            </last-sent-error>
286                            <received-error-msg-count>0</received-error-msg-count>
287                            <last-received-error>
288                               <error-type>0</error-type>
289                               <error-value>0</error-value>
290                            </last-received-error>
291                            <sent-error-msg-count>0</sent-error-msg-count>
292                         </error-messages>
293                         <sent-msg-count>11759</sent-msg-count>
294                         <last-sent-msg-timestamp>1553547804</last-sent-msg-timestamp>
295                         <reply-time>
296                            <average-time>0</average-time>
297                            <min-time>0</min-time>
298                            <max-time>0</max-time>
299                         </reply-time>
300                         <received-rpt-msg-count xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">1</received-rpt-msg-count>
301                         <sent-init-msg-count xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">0</sent-init-msg-count>
302                         <last-received-rpt-msg-timestamp xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">1553195032</last-received-rpt-msg-timestamp>
303                         <sent-upd-msg-count xmlns="urn:opendaylight:params:xml:ns:yang:pcep:stateful:stats">0</sent-upd-msg-count>
304                      </messages>
305                      <peer-pref>
306                         <keepalive>30</keepalive>
307                         <deadtimer>120</deadtimer>
308                         <session-id>8</session-id>
309                         <ip-address>127.0.0.1</ip-address>
310                      </peer-pref>
311                      <delegated-lsps-count>0</delegated-lsps-count>
312                   </pcep-session-state>
313                </node>
314             </topology>
315          </output>
316
317    .. tab:: JSON
318
319       **Content-Type:** ``application/json``
320
321       **Request Body:**
322
323       .. code-block:: json
324
325          {
326              "input": {
327                  "topology": [
328                      {
329                        "topology-id": "pcep-topology",
330                          "node": [
331                              {
332                                  "node-id": "pcc://43.43.43.43"
333                              }
334                          ]
335                      }
336                  ]
337              }
338          }
339
340       **Response Body:**
341
342       .. code-block:: json
343
344          {
345              "output": {
346                  "topology": {
347                      "topology-id": "pcep-topology",
348                      "node": {
349                          "node-id": "pcc://43.43.43.43",
350                          "pcep-session-state": {
351                              "synchronized": true,
352                              "peer-capabilities": {
353                                  "stateful": true,
354                                  "instantiation": true,
355                                  "active": true
356                              },
357                              "local-pref": {
358                                  "keepalive": 30,
359                                  "deadtimer": 120,
360                                  "session-id": 1,
361                                  "ip-address": "127.0.0.1"
362                              },
363                              "session-duration": "4:01:59:46",
364                              "messages": {
365                                  "unknown-msg-received": 0,
366                                  "received-msg-count": 11752,
367                                  "error-messages": {
368                                      "last-sent-error": {
369                                      "error-type": 0,
370                                      "error-value": 0
371                                  },
372                                  "received-error-msg-count": 0,
373                                      "last-received-error": {
374                                      "error-type": 0,
375                                      "error-value": 0
376                                  },
377                                  "sent-error-msg-count": 0
378                              },
379                              "sent-msg-count": 11759,
380                              "last-sent-msg-timestamp": 1553547804,
381                              "reply-time": {
382                                  "average-time": 0,
383                                  "min-time": 0,
384                                  "max-time": 0
385                              },
386                              "received-rpt-msg-count": 1,
387                              "sent-init-msg-count": 0,
388                              "last-received-rpt-msg-timestamp": 1553195032,
389                              "sent-upd-msg-count": 0
390                          },
391                          "peer-pref": {
392                              "keepalive": 30,
393                              "deadtimer": 120,
394                              "session-id": 8,
395                              "ip-address": "127.0.0.1"
396                          },
397                          "delegated-lsps-count": 0
398                      }
399                  }
400              }
401          }