Skip to content

Commit

Permalink
Remove periodic flap stats for XMPP Agent peers
Browse files Browse the repository at this point in the history
At the moment, we do not have any configuration associated with XMPP Agent peer.
Hence lifetime of flap-stats cannot be cleanly managed

Change-Id: I4fd9a8cbc8504bf9aed9bde073bc22af43637240
Partial-Bug: #1576437
  • Loading branch information
ananth-at-camphor-networks committed Aug 2, 2016
1 parent 25b0e18 commit 7ed7bb7
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 33 deletions.
17 changes: 0 additions & 17 deletions src/bgp/bgp_xmpp_channel.cc
Expand Up @@ -2840,28 +2840,11 @@ void BgpXmppChannelManager::FillPeerInfo(const BgpXmppChannel *channel) const {
PeerStatsUve::Send(peer_stats_data, "ObjectXmppPeerInfo");
}

void BgpXmppChannelManager::FillPeerStats(const XmppConnectionEndpoint *endp)
const {
if (!endp)
return;

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

PeerFlapData peer_flap_data;
peer_flap_data.set_name(endp->client());
peer_flap_data.set_flap_info(flap_info);
PeerFlap::Send(peer_flap_data, "ObjectXmppPeerInfo");
}

bool BgpXmppChannelManager::CollectStats(BgpRouterState *state, bool first)
const {
CHECK_CONCURRENCY("bgp::Uve");

VisitChannels(boost::bind(&BgpXmppChannelManager::FillPeerInfo, this, _1));
xmpp_server_->VisitEndpoints(
boost::bind(&BgpXmppChannelManager::FillPeerStats, this, _1));
bool change = false;
uint32_t num_xmpp = count();
if (first || num_xmpp != state->get_num_xmpp_peer()) {
Expand Down
1 change: 0 additions & 1 deletion src/bgp/bgp_xmpp_channel.h
Expand Up @@ -363,7 +363,6 @@ class BgpXmppChannelManager {
friend class BgpXmppUnitTest;

void FillPeerInfo(const BgpXmppChannel *channel) const;
void FillPeerStats(const XmppConnectionEndpoint *endp) const;

XmppServer *xmpp_server_;
BgpServer *bgp_server_;
Expand Down
5 changes: 0 additions & 5 deletions src/xmpp/xmpp_connection.cc
Expand Up @@ -774,11 +774,6 @@ void XmppServerConnection::increment_flap_count() {
flap_info.set_flap_time(conn_endpoint->last_flap());
peer_info.set_flap_info(flap_info);
XMPPPeerInfoSend(peer_info);

PeerFlapData peer_flap_data;
peer_flap_data.set_name(ToUVEKey());
peer_flap_data.set_flap_info(flap_info);
PeerFlap::Send(peer_flap_data, "ObjectXmppPeerInfo");
}

const std::string XmppServerConnection::last_flap_at() const {
Expand Down
8 changes: 0 additions & 8 deletions src/xmpp/xmpp_server.cc
Expand Up @@ -537,14 +537,6 @@ void XmppServer::RemoveDeletedConnection(XmppServerConnection *connection) {
ReleaseConnectionEndpoint(connection);
}

void XmppServer::VisitEndpoints(VisitorFn fn) const {
tbb::mutex::scoped_lock lock(endpoint_map_mutex_);
BOOST_FOREACH(const ConnectionEndpointMap::value_type &i,
connection_endpoint_map_) {
fn(i.second);
}
}

XmppConnectionEndpoint *XmppServer::FindConnectionEndpoint(
const string &endpoint_name) const {
tbb::mutex::scoped_lock lock(endpoint_map_mutex_);
Expand Down
2 changes: 0 additions & 2 deletions src/xmpp/xmpp_server.h
Expand Up @@ -31,7 +31,6 @@ class XmppServerConnection;
class XmppServer : public XmppConnectionManager {
public:
typedef boost::asio::ip::tcp::endpoint Endpoint;
typedef boost::function<void(XmppConnectionEndpoint *)> VisitorFn;

XmppServer(EventManager *evm, const std::string &server_addr,
const XmppChannelConfig *config);
Expand Down Expand Up @@ -71,7 +70,6 @@ class XmppServer : public XmppConnectionManager {

const std::string &ServerAddr() const { return server_addr_; }
size_t ConnectionCount() const;
void VisitEndpoints(VisitorFn fn) const;

XmppConnectionEndpoint *FindConnectionEndpoint(
const std::string &endpoint_name) const;
Expand Down

0 comments on commit 7ed7bb7

Please sign in to comment.