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"),
34 io, agent->params()->agent_stats_interval(),
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());
bool cat_is_dpdk_mocked() const
virtual IoContext * AllocateIoContext(char *buf, uint32_t buf_len, StatsType type, uint32_t seq)
void SendAsync(char *buf, uint32_t buf_len, StatsType type)
void SendVrfStatsBulkGet()
boost::scoped_ptr< AgentStatsSandeshContext > drop_stats_sandesh_ctx_
boost::scoped_ptr< AgentStatsSandeshContext > vrf_stats_sandesh_ctx_
void SendDropStatsBulkGet()
boost::scoped_ptr< AgentStatsSandeshContext > intf_stats_sandesh_ctx_
bool SendRequest(Sandesh &encoder, StatsType type)
void SendInterfaceBulkGet()
virtual ~AgentStatsCollector()
AgentParam * params() const
AgentStatsCollector * stats_collector() const
static Agent * GetInstance()
void GenericSend(IoContext *ctx)
uint32_t AllocSeqNo(IoContext::Type type)
static KSyncSock * Get(DBTablePartBase *partition)
virtual int32_t WriteBinary(u_int8_t *buf, u_int32_t buf_len, int *error)
void set_context(std::string context)
void set_expiry_time(int time)
The TaskScheduler keeps track of what tasks are currently schedulable. When a task is enqueued it is ...
#define KSYNC_DEFAULT_MSG_SIZE