11 #include <sandesh/sandesh_types.h>
12 #include <sandesh/sandesh.h>
13 #include <sandesh/sandesh_uve_types.h>
19 using boost::asio::ip::address;
23 void SandeshMessageStatsReq::HandleRequest()
const {
24 SandeshMessageStatsResp *resp(
new SandeshMessageStatsResp);
25 std::vector<SandeshMessageTypeStats> mtype_stats;
26 SandeshMessageStats magg_stats;
27 GetMsgStats(&mtype_stats, &magg_stats);
28 SandeshGeneratorStats sandesh_stats;
29 sandesh_stats.set_type_stats(mtype_stats);
30 sandesh_stats.set_aggregate_stats(magg_stats);
33 resp->set_session_close_interval_msec(
38 SandeshQueueStats qstats;
39 qstats.set_enqueues(ssession->send_queue()->NumEnqueues());
40 qstats.set_count(ssession->send_queue()->Length());
41 qstats.set_max_count(ssession->send_queue()->max_queue_len());
42 resp->set_send_queue_stats(qstats);
43 resp->set_sending_level(LevelToString(ssession->SendingLevel()));
46 resp->set_stats(sandesh_stats);
47 resp->set_context(context());
52 SandeshLoggingParams *slogger(
new SandeshLoggingParams());
55 if (category.empty()) {
58 slogger->set_category(category);
62 slogger->set_context(context);
66 void SandeshLoggingParamsSet::HandleRequest()
const {
68 if (__isset.log_level) {
71 if (__isset.category) {
72 std::string category = get_category();
73 if (category ==
"*") {
81 if (__isset.trace_print) {
84 if (__isset.enable_flow_log) {
91 void SandeshLoggingParamsStatus::HandleRequest()
const {
97 SandeshSendingParams *ssparams(
new SandeshSendingParams());
107 ssparams->set_context(context);
108 ssparams->Response();
111 void SandeshSendingParamsSet::HandleRequest()
const {
112 if (__isset.system_logs_rate_limit) {
115 if (__isset.disable_object_logs) {
118 if (__isset.disable_all_logs) {
121 if (__isset.disable_flows) {
128 void SandeshSendingParamsStatus::HandleRequest()
const {
134 SandeshSendQueueResponse *ssqr(
new SandeshSendQueueResponse);
136 ssqr->set_context(context);
140 void SandeshSendQueueSet::HandleRequest()
const {
141 if (__isset.enable) {
148 void SandeshSendQueueStatus::HandleRequest()
const {
153 void CollectorInfoRequest::HandleRequest()
const {
154 CollectorInfoResponse *resp (
new CollectorInfoResponse());
157 resp->set_ip(client->
sm_->server().address().to_string());
158 resp->set_port(client->
sm_->server().port());
159 resp->set_status(client->
sm_->StateName());
161 resp->set_context(context());
166 std::vector<Sandesh::QueueWaterMarkInfo> scwm_info;
167 std::vector<SandeshSendQueueParams> ssp_info;
171 for (
size_t i = 0; i < scwm_info.size(); i++) {
173 SandeshSendQueueParams ssp;
174 ssp.set_queue_count(boost::get<0>(scwm));
177 ssp.set_high(boost::get<2>(scwm));
178 ssp_info.push_back(ssp);
181 SandeshSendQueueParamsResponse *sspr(
new SandeshSendQueueParamsResponse);
182 sspr->set_context(context);
183 sspr->set_info(ssp_info);
187 void SandeshSendQueueParamsSet::HandleRequest()
const {
188 if (!(__isset.high && __isset.queue_count && __isset.sending_level)) {
195 size_t qcount(get_queue_count());
196 bool high(get_high());
197 std::string slevel(get_sending_level());
206 void SandeshSendQueueParamsReset::HandleRequest()
const {
215 void SandeshSendQueueParamsStatus::HandleRequest()
const {
static bool IsTracePrintEnabled()
static SandeshLevel::type StringToLevel(std::string level)
int session_close_interval_msec() const
int PullSandeshGenStatsReq
SandeshSession * session() const
static void SetSendQueue(bool enable)
static void set_send_rate_limit(int rate_limit)
boost::scoped_ptr< SandeshClientSM > sm_
uint64_t session_close_time_usec() const
static SandeshLevel::type LoggingLevel()
static void SendSandeshSendingParams(const std::string &context)
void GetSessionWaterMarkInfo(std::vector< Sandesh::QueueWaterMarkInfo > &scwm_info) const
static void SetLoggingCategory(std::string category)
static void DisableSendingObjectLogs(bool disable)
static void SetLocalLogging(bool enable)
void SetSessionWaterMarkInfo(Sandesh::QueueWaterMarkInfo &scwm)
static bool IsFlowLoggingEnabled()
static bool IsSendingObjectLogsDisabled()
static const char * LevelToString(SandeshLevel::type level)
static void SetLoggingLevel(std::string level)
static void SendSandeshLoggingParams(const std::string &context)
static SandeshClient * client()
static void SendSandeshSendQueueParamsResponse(const std::string &context)
static bool IsSendingAllMessagesDisabled()
static std::string LoggingCategory()
static uint32_t get_send_rate_limit()
static bool IsLocalLoggingEnabled()
void ResetSessionWaterMarkInfo()
static void SetFlowLogging(bool enable)
static void SendSandeshSendQueueResponse(std::string context)
boost::tuple< size_t, SandeshLevel::type, bool, bool > QueueWaterMarkInfo
static void DisableSendingAllMessages(bool disable)
static bool IsSendingFlowsDisabled()
static void DisableSendingFlows(bool disable)
static void SetTracePrint(bool enable)
static bool IsSendQueueEnabled()
uint8_t GetDscpValue() const