Skip to content

Commit

Permalink
Send BGP Peer Flap stats periodically
Browse files Browse the repository at this point in the history
This is required in order to generate derived stats correctly

Change-Id: I74fa4c6b6ed7b5ed456d91541bb7677d7f6e064e
Partial-Bug: 1576437
  • Loading branch information
ananth-at-camphor-networks committed Aug 2, 2016
1 parent 6b0ad8a commit a5933f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/bgp/bgp_peer.h
Expand Up @@ -223,6 +223,7 @@ class BgpPeer : public IPeer {
void increment_flap_count();
void reset_flap_count();
uint64_t flap_count() const { return flap_count_; }
uint64_t last_flap() const { return last_flap_; }
uint64_t total_flap_count() const { return total_flap_count_; }

std::string last_flap_at() const;
Expand Down
9 changes: 9 additions & 0 deletions src/bgp/bgp_server.cc
Expand Up @@ -814,6 +814,15 @@ void BgpServer::FillPeerStats(const BgpPeer *peer) const {
peer_stats_data.set_name(peer->ToUVEKey());
PeerStats::FillPeerUpdateStats(peer->peer_stats(), &peer_stats_data);
PeerStatsUve::Send(peer_stats_data, "ObjectBgpPeer");

PeerFlapInfo flap_info;
flap_info.set_flap_count(peer->flap_count());
flap_info.set_flap_time(peer->last_flap());

PeerFlapData peer_flap_data;
peer_flap_data.set_name(peer->ToUVEKey());
peer_flap_data.set_flap_info(flap_info);
PeerFlap::Send(peer_flap_data, "ObjectBgpPeer");
}

bool BgpServer::CollectStats(BgpRouterState *state, bool first) const {
Expand Down

0 comments on commit a5933f9

Please sign in to comment.