21 : m_name(stat_seg_data.
name)
22 , m_type(stat_seg_data.type)
81 : m_socket_name(socket_name)
83 , m_stat_connect(false)
85 , m_stat_seg_data(nullptr)
88 m_patterns.push_back(
"/if");
92 : m_socket_name(
"/run/vpp/stats.sock")
94 , m_stat_connect(false)
96 , m_stat_seg_data(nullptr)
102 std::vector<std::string> patterns)
103 : m_socket_name(socket_name)
104 , m_patterns(patterns)
105 , m_stat_connect(false)
107 , m_stat_seg_data(nullptr)
113 : m_socket_name(
"/run/vpp/stats.sock")
115 , m_stat_connect(false)
117 , m_stat_seg_data(nullptr)
120 m_patterns.push_back(
"/if");
132 : m_socket_name(o.m_socket_name)
133 , m_patterns(o.m_patterns)
141 m_stat_connect =
true;
144 return m_stat_connect;
152 m_stat_connect =
false;
162 stat_client::vec_free(
void* vec)
170 uint8_t** string_vec = { 0 };
171 for (
auto& pattern : m_patterns) {
182 m_stat_seg_data =
NULL;
183 if (m_stat_data.size()) {
186 if (m_stat_connect) {
188 if (!m_stat_seg_data) {
194 m_stat_data.push_back(sd);
204 m_stat_seg_data =
NULL;
205 if (m_stat_data.size()) {
208 if (m_stat_connect) {
210 if (!m_stat_seg_data) {
216 m_stat_data.push_back(sd);
223 stat_client::data_free()
int stat_segment_connect(const char *socket_name)
stat_segment_data_t * stat_segment_dump_entry(uint32_t index)
void stat_segment_data_free(stat_segment_data_t *res)
counter_t ** simple_counter_vec
Combined counter to hold both packets and byte differences.
const std::string & name() const
get name of stat
stat_client()
Stat Client constructor.
vlib_counter_t ** m_combined_counter_vec
int vec_len(void *vec)
Get vector length of VPP style vector.
double get_stat_segment_scalar_data() const
Get pointer to actual data.
void stat_segment_disconnect(void)
vlib_counter_t ** get_stat_segment_combined_counter_data() const
void disconnect()
Disconnect to stat segment.
uint8_t ** stat_segment_string_vector(uint8_t **string_vector, const char *string)
A representation of a stat client in VPP.
const stat_data_vec_t & dump_entry(uint32_t index)
dump stats for given index in stat directory
std::vector< stat_data_t > stat_data_vec_t
vector of stat_data_t
~stat_client()
Stat Client destructor.
char * stat_segment_index_to_name(uint32_t index)
std::string index_to_name(uint32_t index)
get index to name of stat
uint64_t get_stat_segment_error_data() const
uint32_t * stat_segment_ls(uint8_t **patterns)
int connect()
Connect to stat segment.
stat_segment_data_t * stat_segment_dump(uint32_t *stats)
const stat_data_vec_t & dump()
dump all the stats for given pattern
vlib_counter_t ** combined_counter_vec
The VPP Object Model (VOM) library.
counter_t ** m_simple_counter_vec
void stat_segment_vec_free(void *vec)
uint64_t ** get_stat_segment_simple_counter_data() const
const stat_directory_type_t & type() const
get type of stat
int stat_segment_vec_len(void *vec)
stat_data_t(const stat_segment_data_t &stat_seg_data)
stat data custom constructor
double stat_segment_heartbeat(void)