summaryrefslogtreecommitdiffstats
path: root/extras/vom/vom/stat_client.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'extras/vom/vom/stat_client.hpp')
-rw-r--r--extras/vom/vom/stat_client.hpp58
1 files changed, 23 insertions, 35 deletions
diff --git a/extras/vom/vom/stat_client.hpp b/extras/vom/vom/stat_client.hpp
index 4da968a8204..40729feef5f 100644
--- a/extras/vom/vom/stat_client.hpp
+++ b/extras/vom/vom/stat_client.hpp
@@ -26,13 +26,6 @@ extern "C" {
namespace VOM {
-typedef struct
-{
- uint64_t packets;
- uint64_t bytes;
-} counter_t;
-
-typedef uint64_t stat_counter_t;
/**
* A representation of a stat client in VPP
*/
@@ -45,14 +38,9 @@ public:
struct stat_data_t
{
/**
- * stat data constructor
- */
- stat_data_t();
-
- /**
* stat data custom constructor
*/
- stat_data_t(stat_segment_data_t* stat_seg_data);
+ stat_data_t(const stat_segment_data_t& stat_seg_data);
/**
* get name of stat
@@ -67,10 +55,10 @@ public:
/**
* Get pointer to actual data
*/
- double get_stat_segment_scalar_data();
- uint64_t get_stat_segment_error_data();
- uint64_t** get_stat_segment_simple_counter_data();
- counter_t** get_stat_segment_combined_counter_data();
+ double get_stat_segment_scalar_data() const;
+ uint64_t get_stat_segment_error_data() const;
+ uint64_t** get_stat_segment_simple_counter_data() const;
+ vlib_counter_t** get_stat_segment_combined_counter_data() const;
private:
/**
@@ -89,9 +77,9 @@ public:
union
{
double m_scalar_value;
- uint64_t m_error_Value;
- uint64_t** m_simple_counter_vec;
- counter_t** m_combined_counter_vec;
+ uint64_t m_error_value;
+ counter_t** m_simple_counter_vec;
+ vlib_counter_t** m_combined_counter_vec;
};
};
@@ -141,43 +129,43 @@ public:
void disconnect();
/**
- * Get vector length of VPP style vector
+ * dump all the stats for given pattern
*/
- int vec_len(void* vec);
+ const stat_data_vec_t& dump();
/**
- * Free VPP style vector
+ * dump stats for given index in stat directory
*/
- void vec_free(void* vec);
+ const stat_data_vec_t& dump_entry(uint32_t index);
/**
- * ls on the stat directory using given pattern
+ * Get vector length of VPP style vector
*/
- void ls();
+ int vec_len(void* vec);
+
+ double heartbeat();
/**
- * dump all the stats for given pattern
+ * get index to name of stat
*/
- const stat_data_vec_t& dump();
+ std::string index_to_name(uint32_t index);
+private:
/**
- * dump stats for given index in stat directory
+ * Free VPP style vector
*/
- const stat_data_vec_t& dump_entry(uint32_t index);
+ void vec_free(void* vec);
/**
* Free stat segment data
*/
void data_free();
- double heartbeat();
-
/**
- * get index to name of stat
+ * ls on the stat directory using given pattern
*/
- std::string index_to_name(uint32_t index);
+ void ls();
-private:
/**
* socket name
*/