21 : m_name(stat_seg_data.
name)
22 , m_type(stat_seg_data.type)
79 : m_socket_name(socket_name)
81 , m_stat_connect(false)
83 , m_stat_seg_data(nullptr)
86 m_patterns.push_back(
"/if");
90 : m_socket_name(
"/run/vpp/stats.sock")
92 , m_stat_connect(false)
94 , m_stat_seg_data(nullptr)
100 std::vector<std::string> patterns)
101 : m_socket_name(socket_name)
102 , m_patterns(patterns)
103 , m_stat_connect(false)
105 , m_stat_seg_data(nullptr)
111 : m_socket_name(
"/run/vpp/stats.sock")
113 , m_stat_connect(false)
115 , m_stat_seg_data(nullptr)
118 m_patterns.push_back(
"/if");
130 : m_socket_name(o.m_socket_name)
131 , m_patterns(o.m_patterns)
139 m_stat_connect =
true;
142 return m_stat_connect;
150 m_stat_connect =
false;
160 stat_client::vec_free(
void* vec)
168 uint8_t** string_vec = { 0 };
169 for (
auto& pattern : m_patterns) {
180 m_stat_seg_data =
NULL;
181 if (m_stat_data.size()) {
184 if (m_stat_connect) {
186 if (!m_stat_seg_data) {
192 m_stat_data.push_back(sd);
202 m_stat_seg_data =
NULL;
203 if (m_stat_data.size()) {
206 if (m_stat_connect) {
208 if (!m_stat_seg_data) {
214 m_stat_data.push_back(sd);
221 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)