21 stat_reader::stat_indexes_t stat_reader::m_stat_itf_indexes;
50 stat_reader::registers(
const interface& intf)
52 m_stat_itf_indexes.insert(intf.handle_i().
value());
56 stat_reader::unregisters(
const interface& intf)
58 m_stat_itf_indexes.erase(intf.handle_i().
value());
64 std::set<std::shared_ptr<interface>> itfs_w_stats;
67 for (
auto& sde : sd) {
70 if (sde.name().empty())
75 if (name.find(
"/if") != std::string::npos)
88 data = sde.get_stat_segment_simple_counter_data();
90 for (
auto&
i : m_stat_itf_indexes) {
93 for (
int k = 0; k < m_client.
vec_len(data); k++) {
99 itf->set(count, name);
100 itfs_w_stats.insert(itf);
109 data = sde.get_stat_segment_combined_counter_data();
111 for (
auto&
i : m_stat_itf_indexes) {
114 for (
int k = 0; k < m_client.
vec_len(data); k++) {
121 itf->set(count, name);
122 itfs_w_stats.insert(itf);
129 for (
auto itf : itfs_w_stats) {
130 itf->publish_stats();
stat_reader()
Default Constructor.
uint32_t value() const
get the value of the handle
static std::shared_ptr< interface > find(const handle_t &h)
The the singular instance of the interface in the DB by handle.
virtual void read()
read stats for registered objects from stat_segment and set those stats to respective objects ...
Combined counter to hold both packets and byte differences.
virtual int connect()
connection to stat object
counter_t packets
packet counter
int vec_len(void *vec)
Get vector length of VPP style vector.
void disconnect()
Disconnect to stat segment.
A representation of a stat client in VPP.
~stat_reader()
Destructor.
std::vector< stat_data_t > stat_data_vec_t
vector of stat_data_t
A representation of an interface in VPP.
int connect()
Connect to stat segment.
const stat_data_vec_t & dump()
dump all the stats for given pattern
counter_t bytes
byte counter
The VPP Object Model (VOM) library.
virtual void disconnect()
disconnect to stat object
static struct st_util_session_cache_t sc