diff options
author | Ole Troan <ot@cisco.com> | 2018-09-04 13:19:12 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-09-17 10:07:27 +0000 |
commit | 58492a83722caf1c49977d73abf931418ce1f8f2 (patch) | |
tree | 0e2f7e031fbfa10c35448c9660292146aeb442b1 /src/vpp-api/client/stat_client.h | |
parent | 40ea3f59dca497e5f4b5a8440a9c8c2e37396701 (diff) |
STATS: Dynamically mapped shared memory segment
Move from using a hash to a vector with offsets into shared memory.
Limit exposure of VPP data structures and include files to
external stats library and applications.
Change-Id: Ic06129f12d10cf4c4946a86d9bc734eacff2c7da
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vpp-api/client/stat_client.h')
-rw-r--r-- | src/vpp-api/client/stat_client.h | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/src/vpp-api/client/stat_client.h b/src/vpp-api/client/stat_client.h index 73e91b1881b..c1a0ecf4753 100644 --- a/src/vpp-api/client/stat_client.h +++ b/src/vpp-api/client/stat_client.h @@ -17,8 +17,9 @@ #ifndef included_stat_client_h #define included_stat_client_h -#include <vlib/vlib.h> -#include <vpp/stats/stats.h> +#include <stdint.h> +#include <vpp/stats/stat_segment.h> +#include <vlib/counter_types.h> typedef struct { @@ -26,31 +27,25 @@ typedef struct stat_directory_type_t type; union { - f64 scalar_value; - u64 error_value; - u64 *vector_pointer; + double scalar_value; + uint64_t error_value; counter_t **simple_counter_vec; vlib_counter_t **combined_counter_vec; }; } stat_segment_data_t; -typedef struct -{ - char *name; - stat_segment_directory_entry_t *ep; -} stat_segment_cached_pointer_t; - int stat_segment_connect (char *socket_name); void stat_segment_disconnect (void); -u8 **stat_segment_ls (u8 ** pattern); -stat_segment_data_t *stat_segment_dump (u8 ** counter_vec); -stat_segment_cached_pointer_t *stat_segment_register (u8 ** counter_vec); -/* Collects registered counters */ -stat_segment_data_t *stat_segment_collect (stat_segment_cached_pointer_t *); -void stat_segment_data_free (stat_segment_data_t * res); -f64 stat_segment_heartbeat (void); -u8 **stat_segment_string_vector (u8 ** string_vector, char *string); +uint8_t **stat_segment_string_vector (uint8_t ** string_vector, char *string); int stat_segment_vec_len (void *vec); +uint32_t *stat_segment_ls (uint8_t ** pattern); +stat_segment_data_t *stat_segment_dump (uint32_t * counter_vec); +stat_segment_data_t *stat_segment_dump_entry (uint32_t index); +void stat_segment_data_free (stat_segment_data_t * res); + +double stat_segment_heartbeat (void); + +char *stat_segment_index_to_name (uint32_t index); #endif /* included_stat_client_h */ |