Skip to content

Commit

Permalink
Merge "Send VMI and VM counts from Vrouter UVE."
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Jan 17, 2017
2 parents 050c87b + 54e219b commit def7cff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
12 changes: 11 additions & 1 deletion src/vnsw/agent/uve/vrouter.sandesh
Expand Up @@ -87,6 +87,13 @@ struct AgentInterface {
2: string mac_address;
}

/**
* Sandesh definition for count of Agent objects
*/
struct VrouterAgentObjectCount {
1: u16 active
}

/**
* Structure definition for vrouter-agent information
*/
Expand Down Expand Up @@ -158,7 +165,8 @@ struct VrouterAgent {
/** Count of total number of virtual-machine-interfaces that are part of
* this vrouter
*/
31: optional u16 total_interface_count;
/** @display_name:Vrouter Agent VMI count */
31: optional VrouterAgentObjectCount vmi_count (tags="")
/** Count of total number of virtual-machine-interfaces that are part of
* this vrouter and that are in INACTIVE state
*/
Expand Down Expand Up @@ -218,6 +226,8 @@ struct VrouterAgent {
51: optional string platform;
/** Maximum entries supported in each type of object*/
52: optional agent.VrouterObjectLimits vr_limits;
/** @display_name:Vrouter Agent VM count */
53: optional VrouterAgentObjectCount vm_count (tags="")
}

/**
Expand Down
12 changes: 6 additions & 6 deletions src/vnsw/agent/uve/vrouter_uve_entry_base.cc
Expand Up @@ -158,6 +158,9 @@ void VrouterUveEntryBase::VmWalkDone(DBTableBase *base, StringVectorPtr list) {
VrouterAgent vrouter_agent;
vrouter_agent.set_name(agent_->agent_name());
vrouter_agent.set_virtual_machine_list(*(list.get()));
VrouterAgentObjectCount vm_count;
vm_count.set_active(list.get()->size());
vrouter_agent.set_vm_count(vm_count);
DispatchVrouterMsg(vrouter_agent);
vm_walk_id_ = DBTableWalker::kInvalidWalkerId;

Expand Down Expand Up @@ -306,8 +309,9 @@ void VrouterUveEntryBase::InterfaceWalkDone(DBTableBase *base,
prev_vrouter_.set_unmanaged_if_list(*(unmanaged_list.get()));
}

vrouter_agent.set_total_interface_count((if_list.get()->size() +
nova_if_list.get()->size()));
VrouterAgentObjectCount vmi_count;
vmi_count.set_active((if_list.get()->size() + nova_if_list.get()->size()));
vrouter_agent.set_vmi_count(vmi_count);
vrouter_agent.set_down_interface_count((err_if_list.get()->size() +
nova_if_list.get()->size()));
DispatchVrouterMsg(vrouter_agent);
Expand All @@ -317,10 +321,6 @@ void VrouterUveEntryBase::InterfaceWalkDone(DBTableBase *base,
prev_vrouter_.set_interface_list(*(if_list.get()));
prev_vrouter_.set_error_intf_list(*(err_if_list.get()));
prev_vrouter_.set_no_config_intf_list(*(nova_if_list.get()));
prev_vrouter_.set_total_interface_count
(vrouter_agent.get_total_interface_count());
prev_vrouter_.set_down_interface_count
(vrouter_agent.get_down_interface_count());

/* Restart the timer after we are done with the walk */
StartTimer();
Expand Down

0 comments on commit def7cff

Please sign in to comment.