13 #include "vr_genetlink.h"
14 #include "vr_interface.h"
28 #include <vrouter/stats_collector/agent_stats_interval_types.h>
31 (boost::asio::io_context &
io,
Agent* agent)
33 GetTaskId(
"Agent::StatsCollector"),
35 io, agent->params()->agent_stats_interval(),
36 "Agent Stats collector"),
48 vr_interface_req encoder;
50 encoder.set_h_op(sandesh_op::DUMP);
51 encoder.set_vifr_context(0);
54 encoder.set_vifr_flags(VIF_FLAG_GET_DROP_STATS);
59 vr_vrf_stats_req encoder;
61 encoder.set_h_op(sandesh_op::DUMP);
62 encoder.set_vsr_rid(0);
63 encoder.set_vsr_family(AF_INET);
69 vr_drop_stats_req encoder;
71 encoder.set_h_op(sandesh_op::GET);
72 encoder.set_vds_rid(0);
73 encoder.set_vds_core(0);
135 void SetAgentStatsInterval_InSeconds::HandleRequest()
const {
139 resp =
new AgentStatsCfgResp();
140 }
else if (get_interval() > 0) {
142 resp =
new AgentStatsCfgResp();
144 resp =
new AgentStatsCfgErrResp();
152 void GetAgentStatsInterval::HandleRequest()
const {
153 AgentStatsIntervalResp_InSeconds *resp =
154 new AgentStatsIntervalResp_InSeconds();
157 resp->set_agent_stats_interval((col->
expiry_time())/1000);
159 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