Skip to content

Commit

Permalink
Merge "Remove instance stats uve upon instance deletion" into R3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Oct 19, 2016
2 parents fa876ae + f3132e1 commit 092978e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bgp/bgp_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,13 @@ uint32_t BgpServer::SendTableStatsUve(bool first) const {
table->GetSecondaryPathCount());
}

if (first || table->stats()->get_infeasible_paths() !=
table->GetInfeasiblePathCount()) {
changed = true;
table->stats()->set_infeasible_paths(
table->GetSecondaryPathCount());
}

uint64_t total_paths = table->stats()->get_primary_paths() +
table->stats()->get_secondary_paths() +
table->stats()->get_infeasible_paths();
Expand Down
7 changes: 7 additions & 0 deletions src/bgp/routing-instance/routing_instance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "bgp/bgp_factory.h"
#include "bgp/bgp_log.h"
#include "bgp/bgp_server.h"
#include "bgp/bgp_table_types.h"
#include "bgp/routing-instance/iroute_aggregator.h"
#include "bgp/routing-instance/iservice_chain_mgr.h"
#include "bgp/routing-instance/istatic_route_mgr.h"
Expand Down Expand Up @@ -426,6 +427,12 @@ void RoutingInstanceMgr::DestroyRoutingInstance(RoutingInstance *rtinstance) {
RTINSTANCE_LOG(Destroy, rtinstance,
SandeshLevel::SYS_DEBUG, RTINSTANCE_LOG_FLAG_ALL);

// Delete instance stats uve.
RoutingInstanceStatsData instance_info;
instance_info.set_name(rtinstance->name());
instance_info.set_deleted(true);
RoutingInstanceStats::Send(instance_info);

// Remove call here also deletes the instance.
const string name = rtinstance->name();
instances_.Remove(rtinstance->name(), rtinstance->index());
Expand Down

0 comments on commit 092978e

Please sign in to comment.