21 : m_name(stat_seg_data.
name)
22 , m_type(stat_seg_data.
type)
83 : m_socket_name(socket_name)
85 , m_stat_connect(false)
87 , m_stat_seg_data(nullptr)
90 m_patterns.push_back(
"/if");
94 : m_socket_name(
"/run/vpp/stats.sock")
96 , m_stat_connect(false)
98 , m_stat_seg_data(nullptr)
103 std::vector<std::string> patterns)
104 : m_socket_name(socket_name)
105 , m_patterns(patterns)
106 , m_stat_connect(false)
108 , 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)
140 m_stat_connect =
true;
143 return m_stat_connect;
151 m_stat_connect =
false;
161 stat_client::vec_free(
void* vec)
169 uint8_t** string_vec = { 0 };
170 for (
auto& pattern : m_patterns) {
181 m_stat_seg_data = NULL;
182 if (m_stat_data.size()) {
185 if (m_stat_connect) {
187 if (!m_stat_seg_data) {
193 m_stat_data.push_back(sd);
203 m_stat_seg_data = NULL;
204 if (m_stat_data.size()) {
207 if (m_stat_connect) {
209 if (!m_stat_seg_data) {
215 m_stat_data.push_back(sd);
222 stat_client::data_free()
int stat_segment_connect(const char *socket_name)
stat_segment_data_t * stat_segment_dump_entry(uint32_t index)
const stat_directory_type_t & type() const
get type of stat
void stat_segment_data_free(stat_segment_data_t *res)
counter_t ** simple_counter_vec
vlib_counter_t ** get_stat_segment_combined_counter_data() const
Combined counter to hold both packets and byte differences.
stat_client()
Stat Client constructor.
vlib_counter_t ** m_combined_counter_vec
vl_api_fib_path_type_t type
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)
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.
uint64_t * get_stat_segment_error_data() const
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)
uint64_t ** get_stat_segment_simple_counter_data() const
std::string index_to_name(uint32_t index)
get index to name of stat
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)
int stat_segment_vec_len(void *vec)
const std::string & name() const
get name of stat
stat_data_t(const stat_segment_data_t &stat_seg_data)
stat data custom constructor
double stat_segment_heartbeat(void)