12 #include "vr_genetlink.h"
13 #include "vr_interface.h"
27 #include <vrouter/stats_collector/agent_stats_interval_types.h>
30 (boost::asio::io_context &io,
Agent* agent)
32 GetTaskId(
"Agent::StatsCollector"),
35 "Agent Stats collector"),
47 vr_interface_req encoder;
49 encoder.set_h_op(sandesh_op::DUMP);
50 encoder.set_vifr_context(0);
53 encoder.set_vifr_flags(VIF_FLAG_GET_DROP_STATS);
58 vr_vrf_stats_req encoder;
60 encoder.set_h_op(sandesh_op::DUMP);
61 encoder.set_vsr_rid(0);
62 encoder.set_vsr_family(AF_INET);
68 vr_drop_stats_req encoder;
70 encoder.set_h_op(sandesh_op::GET);
71 encoder.set_vds_rid(0);
72 encoder.set_vds_core(0);
134 void SetAgentStatsInterval_InSeconds::HandleRequest()
const {
138 resp =
new AgentStatsCfgResp();
139 }
else if (get_interval() > 0) {
141 resp =
new AgentStatsCfgResp();
143 resp =
new AgentStatsCfgErrResp();
151 void GetAgentStatsInterval::HandleRequest()
const {
152 AgentStatsIntervalResp_InSeconds *resp =
153 new AgentStatsIntervalResp_InSeconds();
156 resp->set_agent_stats_interval((col->
expiry_time())/1000);
158 resp->set_context(context());
boost::scoped_ptr< AgentStatsSandeshContext > intf_stats_sandesh_ctx_
static Agent * GetInstance()
void SendInterfaceBulkGet()
virtual int32_t WriteBinary(u_int8_t *buf, u_int32_t buf_len, int *error)
void SendAsync(char *buf, uint32_t buf_len, StatsType type)
virtual ~AgentStatsCollector()
void SendDropStatsBulkGet()
void GenericSend(IoContext *ctx)
bool cat_is_dpdk_mocked() const
AgentStatsCollector(boost::asio::io_context &io, Agent *agent)
void set_expiry_time(int time)
#define KSYNC_DEFAULT_MSG_SIZE
static KSyncSock * Get(DBTablePartBase *partition)
static TaskScheduler * GetInstance()
bool SendRequest(Sandesh &encoder, StatsType type)
uint32_t AllocSeqNo(IoContext::Type type)
AgentStatsCollector * stats_collector() const
int agent_stats_interval() const
AgentParam * params() const
void SendVrfStatsBulkGet()
boost::scoped_ptr< AgentStatsSandeshContext > vrf_stats_sandesh_ctx_
void set_context(std::string context)
virtual IoContext * AllocateIoContext(char *buf, uint32_t buf_len, StatsType type, uint32_t seq)
boost::scoped_ptr< AgentStatsSandeshContext > drop_stats_sandesh_ctx_