diff --git a/src/bgp/bgp_peer.h b/src/bgp/bgp_peer.h index 7658ffce59b..1a8a2ecf118 100644 --- a/src/bgp/bgp_peer.h +++ b/src/bgp/bgp_peer.h @@ -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; diff --git a/src/bgp/bgp_server.cc b/src/bgp/bgp_server.cc index c0c60eb8908..c5af87aa525 100644 --- a/src/bgp/bgp_server.cc +++ b/src/bgp/bgp_server.cc @@ -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 {