14 #include "control-node/sandesh/control_node_types.h"
27 const IFMapServer *ifmap_server,
const string &build_info) {
29 static bool first =
true;
30 static BgpRouterState state;
41 vector<string> ip_list;
43 if (first || state.get_bgp_router_ip_list() != ip_list) {
44 state.set_bgp_router_ip_list(ip_list);
49 if (first || build_info != state.get_build_info()) {
50 state.set_build_info(build_info);
59 assert(!state.get_name().empty());
60 BGPRouterInfo::Send(state);
63 memset(static_cast<void*>(&state.__isset), 0,
sizeof(state.__isset));
67 int rc = malloc_trim(0);
69 LOG(ERROR,
"Control-node free memory is not released to system,"
78 node_info_trigger->
Set();
87 const IFMapServer *ifmap_server,
const string &build_info) {
91 xmpp_channel_mgr, ifmap_server, build_info),
95 "ControlNode Info log timer"));
static std::string GetSelfIp()
static std::string prog_name_
boost::asio::io_context * io_service()
static std::string self_ip_
static std::unique_ptr< Timer > node_info_log_timer
static TaskScheduler * GetInstance()
static std::unique_ptr< TaskTrigger > node_info_trigger
#define CHECK_CONCURRENCY(...)
bool CollectStats(BgpRouterState *state, bool first) const
static bool ControlNodeInfoLogTimer(TaskTrigger *node_info_trigger)
static Timer * CreateTimer(boost::asio::io_context &service, const std::string &name, int task_id=Timer::GetTimerTaskId(), int task_instance=Timer::GetTimerInstanceId(), bool delete_on_completion=false)
bool CollectStats(BgpRouterState *state, bool first) const
static uint64_t UTCTimestampUsec()
bool CollectStats(BgpRouterState *state, bool first) const
#define LOG(_Level, _Msg)
static bool ControlNodeInfoLogger(const BgpServer *server, const BgpXmppChannelManager *xmpp_channel_mgr, const IFMapServer *ifmap_server, const std::string &build_info)
static void StartControlNodeInfoLogger(EventManager &evm, uint64_t period_msecs, const BgpServer *server, const BgpXmppChannelManager *xmpp_channel_mgr, const IFMapServer *ifmap_server, const string &build_info)
static std::string hostname_
static bool DeleteTimer(Timer *Timer)
const std::string & localname() const