Merge "Add router count metric for ovs plugin"

This commit is contained in:
Jenkins 2017-03-06 15:53:16 +00:00 committed by Gerrit Code Review
commit ba1f5ebf23
2 changed files with 4 additions and 0 deletions

View File

@ -151,6 +151,7 @@ instances:
| Name | Description |
| ---------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ovs.vrouter.host_max_bw_kb | Maximum bandwidth possible for routers on the the host based on the instances using those routers (if `publish_router_capacity` is true). Only published to the operations tenant. |
| ovs.vrouter.active_routers | Count of active routers on this host (only published to the operations tenant) |
## Mapping Metrics to Configuration Parameters
Configuration parameters can be used to control which metrics are reported by ovs plugin. There are 4 parameters currently in ovs config file: use_rate_metrics, use_absolute_metrics, use_health_metrics and publish_router_capacity.

View File

@ -135,6 +135,7 @@ class OvsCheck(AgentCheck):
#
tried_one_update = False
host_router_max_bw = 0
active_routers = 0
for ifx, value in ifx_deltas.iteritems():
port_uuid = value['port_uuid']
@ -172,6 +173,7 @@ class OvsCheck(AgentCheck):
ifx_dimensions = {'resource_id': device_uuid,
'port_id': port_uuid,
'router_name': router_name}
active_routers += 1
else:
ifx_dimensions = {'resource_id': device_uuid,
'port_id': port_uuid}
@ -233,6 +235,7 @@ class OvsCheck(AgentCheck):
self.gauge('ovs.vrouter.host_max_bw_kb', host_router_max_bw,
dimensions=dims_base)
self.gauge('ovs.vrouter.active_routers', active_routers, dimensions=dims_base)
self._update_counter_cache(ctr_cache,
math.ceil(time.time() - time_start), measure)