12 #include <sandesh/sandesh_types.h>
13 #include <sandesh/sandesh.h>
14 #include <sandesh/sandesh_uve_types.h>
20 using boost::asio::ip::address;
24 void SandeshMessageStatsReq::HandleRequest()
const {
25 SandeshMessageStatsResp *resp(
new SandeshMessageStatsResp);
26 std::vector<SandeshMessageTypeStats> mtype_stats;
27 SandeshMessageStats magg_stats;
28 GetMsgStats(&mtype_stats, &magg_stats);
29 SandeshGeneratorStats sandesh_stats;
30 sandesh_stats.set_type_stats(mtype_stats);
31 sandesh_stats.set_aggregate_stats(magg_stats);
34 resp->set_session_close_interval_msec(
39 SandeshQueueStats qstats;
43 resp->set_send_queue_stats(qstats);
44 resp->set_sending_level(LevelToString(ssession->
SendingLevel()));
47 resp->set_stats(sandesh_stats);
48 resp->set_context(context());
53 SandeshLoggingParams *slogger(
new SandeshLoggingParams());
56 if (category.empty()) {
59 slogger->set_category(category);
63 slogger->set_context(context);
67 void SandeshLoggingParamsSet::HandleRequest()
const {
69 if (__isset.log_level) {
72 if (__isset.category) {
73 std::string category = get_category();
74 if (category ==
"*") {
82 if (__isset.trace_print) {
85 if (__isset.enable_flow_log) {
92 void SandeshLoggingParamsStatus::HandleRequest()
const {
98 SandeshSendingParams *ssparams(
new SandeshSendingParams());
108 ssparams->set_context(context);
109 ssparams->Response();
112 void SandeshSendingParamsSet::HandleRequest()
const {
113 if (__isset.system_logs_rate_limit) {
116 if (__isset.disable_object_logs) {
119 if (__isset.disable_all_logs) {
122 if (__isset.disable_flows) {
129 void SandeshSendingParamsStatus::HandleRequest()
const {
135 SandeshSendQueueResponse *ssqr(
new SandeshSendQueueResponse);
137 ssqr->set_context(context);
141 void SandeshSendQueueSet::HandleRequest()
const {
142 if (__isset.enable) {
149 void SandeshSendQueueStatus::HandleRequest()
const {
154 void CollectorInfoRequest::HandleRequest()
const {
155 CollectorInfoResponse *resp (
new CollectorInfoResponse());
158 resp->set_ip(client->
sm_->server().address().to_string());
159 resp->set_port(client->
sm_->server().port());
160 resp->set_status(client->
sm_->StateName());
162 resp->set_context(context());
167 std::vector<Sandesh::QueueWaterMarkInfo> scwm_info;
168 std::vector<SandeshSendQueueParams> ssp_info;
172 for (
size_t i = 0; i < scwm_info.size(); i++) {
174 SandeshSendQueueParams ssp;
175 ssp.set_queue_count(boost::get<0>(scwm));
178 ssp.set_high(boost::get<2>(scwm));
179 ssp_info.push_back(ssp);
182 SandeshSendQueueParamsResponse *sspr(
new SandeshSendQueueParamsResponse);
183 sspr->set_context(context);
184 sspr->set_info(ssp_info);
188 void SandeshSendQueueParamsSet::HandleRequest()
const {
189 if (!(__isset.high && __isset.queue_count && __isset.sending_level)) {
196 size_t qcount(get_queue_count());
197 bool high(get_high());
198 std::string slevel(get_sending_level());
207 void SandeshSendQueueParamsReset::HandleRequest()
const {
216 void SandeshSendQueueParamsStatus::HandleRequest()
const {
int session_close_interval_msec() const
SandeshSession * session() const
void GetSessionWaterMarkInfo(std::vector< Sandesh::QueueWaterMarkInfo > &scwm_info) const
void ResetSessionWaterMarkInfo()
uint64_t session_close_time_usec() const
boost::scoped_ptr< SandeshClientSM > sm_
void SetSessionWaterMarkInfo(Sandesh::QueueWaterMarkInfo &scwm)
Sandesh::SandeshQueue * send_queue()
SandeshLevel::type SendingLevel() const
static void SetLoggingLevel(std::string level)
static SandeshLevel::type LoggingLevel()
boost::tuple< size_t, SandeshLevel::type, bool, bool > QueueWaterMarkInfo
static void DisableSendingFlows(bool disable)
static std::string LoggingCategory()
static bool IsTracePrintEnabled()
static bool IsLocalLoggingEnabled()
static void SetLocalLogging(bool enable)
static bool IsSendQueueEnabled()
static void SetSendQueue(bool enable)
static bool IsFlowLoggingEnabled()
static SandeshClient * client()
static void SetLoggingCategory(std::string category)
static bool IsSendingObjectLogsDisabled()
static bool IsSendingAllMessagesDisabled()
static const char * LevelToString(SandeshLevel::type level)
static void set_send_rate_limit(int rate_limit)
static uint32_t get_send_rate_limit()
static void DisableSendingAllMessages(bool disable)
static void SetFlowLogging(bool enable)
static bool IsSendingFlowsDisabled()
static void SetTracePrint(bool enable)
static void DisableSendingObjectLogs(bool disable)
static SandeshLevel::type StringToLevel(std::string level)
uint8_t GetDscpValue() const
size_t max_queue_len() const
size_t NumEnqueues() const
static void SendSandeshSendQueueResponse(std::string context)
static void SendSandeshSendingParams(const std::string &context)
static void SendSandeshSendQueueParamsResponse(const std::string &context)
static void SendSandeshLoggingParams(const std::string &context)
int PullSandeshGenStatsReq