diff options
author | Ole Troan <ot@cisco.com> | 2018-06-14 09:28:27 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-06-15 12:07:40 +0000 |
commit | 1ec0ea85c3f57f4638e32a00396057f80d958ec9 (patch) | |
tree | fba386994bf101d4fda3a87af7d5e1a783cdf4c1 /src/vpp | |
parent | c22f87b8763c844e09177e30bbb92830cd928812 (diff) |
STATS: Add more hierarchy to counters.
Put error counters under node_index.
/err/<node-name>/<error-name>
E.g:
/err/ip4-lookup/Hash table collisions
/err/ip6-rewrite/Buffer allocation error
Error names are not globally unique, and this allows
for walking all errors for a particular node.
Put interface counters under the directory /if.
E.g. /if/rx
Put system counters under the directory /sys.
E.g. /sys/vector_rate
Change-Id: I5b794d16698f61bcb2063a8cd77a7c4ae36419b8
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vpp')
-rw-r--r-- | src/vpp/app/stat_client.c | 14 | ||||
-rw-r--r-- | src/vpp/stats/stat_segment.c | 8 |
2 files changed, 10 insertions, 12 deletions
diff --git a/src/vpp/app/stat_client.c b/src/vpp/app/stat_client.c index 96c1bda2c8d..b3dee5331ca 100644 --- a/src/vpp/app/stat_client.c +++ b/src/vpp/app/stat_client.c @@ -142,17 +142,15 @@ connect_to_vpp (stat_client_main_t * sm) } #define foreach_cached_pointer \ -_(vector_rate, SCALAR_POINTER, &stat_client_main.vector_rate_ptr) \ -_(input_rate, SCALAR_POINTER, &stat_client_main.input_rate_ptr) \ -_(last_update, SCALAR_POINTER, &stat_client_main.last_runtime_ptr) \ -_(last_stats_clear, SCALAR_POINTER, \ +_(/sys/vector_rate, SCALAR_POINTER, &stat_client_main.vector_rate_ptr) \ +_(/sys/input_rate, SCALAR_POINTER, &stat_client_main.input_rate_ptr) \ +_(/sys/last_update, SCALAR_POINTER, &stat_client_main.last_runtime_ptr) \ +_(/sys/last_stats_clear, SCALAR_POINTER, \ &stat_client_main.last_runtime_stats_clear_ptr) \ -_(rx, COUNTER_VECTOR, &stat_client_main.intfc_rx_counters) \ -_(tx, COUNTER_VECTOR, &stat_client_main.intfc_tx_counters) \ +_(/if/rx, COUNTER_VECTOR, &stat_client_main.intfc_rx_counters) \ +_(/if/tx, COUNTER_VECTOR, &stat_client_main.intfc_tx_counters) \ _(/err/0/counter_vector, VECTOR_POINTER, \ &stat_client_main.thread_0_error_counts) \ -_(/err/IP4 source address matches local interface, ERROR_INDEX, \ - &stat_client_main.source_address_match_error_index) \ _(serialized_nodes, SERIALIZED_NODES, \ &stat_client_main.serialized_nodes) diff --git a/src/vpp/stats/stat_segment.c b/src/vpp/stats/stat_segment.c index 16a727dbf64..08f1d309f50 100644 --- a/src/vpp/stats/stat_segment.c +++ b/src/vpp/stats/stat_segment.c @@ -232,28 +232,28 @@ vlib_map_stat_segment_init (void) sm->last_runtime_ptr = (scalar_data + 2); sm->last_runtime_stats_clear_ptr = (scalar_data + 3); - name = format (0, "vector_rate%c", 0); + name = format (0, "/sys/vector_rate%c", 0); ep = clib_mem_alloc (sizeof (*ep)); ep->type = STAT_DIR_TYPE_SCALAR_POINTER; ep->value = sm->vector_rate_ptr; hash_set_mem (sm->counter_vector_by_name, name, ep); - name = format (0, "input_rate%c", 0); + name = format (0, "/sys/input_rate%c", 0); ep = clib_mem_alloc (sizeof (*ep)); ep->type = STAT_DIR_TYPE_SCALAR_POINTER; ep->value = sm->input_rate_ptr; hash_set_mem (sm->counter_vector_by_name, name, ep); - name = format (0, "last_update%c", 0); + name = format (0, "/sys/last_update%c", 0); ep = clib_mem_alloc (sizeof (*ep)); ep->type = STAT_DIR_TYPE_SCALAR_POINTER; ep->value = sm->last_runtime_ptr; hash_set_mem (sm->counter_vector_by_name, name, ep); - name = format (0, "last_stats_clear%c", 0); + name = format (0, "/sys/last_stats_clear%c", 0); ep = clib_mem_alloc (sizeof (*ep)); ep->type = STAT_DIR_TYPE_SCALAR_POINTER; ep->value = sm->last_runtime_stats_clear_ptr; |