-# Statistics
+# Statistics {#stats_doc}
In VPP most things are measured and counted. There are counters for interface statistics, like RX, TX counters, packet drops, and so on. Every node has a set of per-node counters, one set of error counters, like TTL exceeded, or packet to big or out-of-buffers. And a set of performance counters, like number of clocks, vectors, calls and suspends.
### Python
```
-#!/usr/bin/env python
+#!/usr/bin/env python3
from vpp_papi.vpp_stats import VPPStats
-stats = VPPStats('/var/run/stats.socks')
+stats = VPPStats('/run/vpp/stats.sock')
dir = stats.ls(['^/if', '/err/ip4-input', '/sys/node/ip4-input'])
counters = stats.dump(dir)
vec_add1(patterns, "^/if");
vec_add1(patterns, "ip4-input");
- int rv = stat_segment_connect("/var/run/stats.sock");
+ int rv = stat_segment_connect(STAT_SEGMENT_SOCKET_FILE);
uint32_t *dir = stat_segment_ls(patterns);
stat_segment_data_t *res = stat_segment_dump(dir);
break;
case STAT_DIR_TYPE_ERROR_INDEX:
- fformat (stdout, "%llu %s\n", res[i].error_value, res[i].name);
+ for (j = 0; j < vec_len (res[i].error_vector); j++)
+ fformat (stdout, "[@%d] %llu %s\n", j, res[i].error_vector[j], res[i].name);
break;
case STAT_DIR_TYPE_SCALAR_INDEX: