[VOL-1698] OMCI PM does not work
Pass ONU's serial number to OnuPmMetrics
Change-Id: Ia45f551c185414b71be6502a7bb71665f9050541
diff --git a/VERSION b/VERSION
index 0ea3a94..a5fea60 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.2.0
+0.2.1-dev
diff --git a/pyvoltha/adapters/extensions/kpi/adapter_pm_metrics.py b/pyvoltha/adapters/extensions/kpi/adapter_pm_metrics.py
index 4ff55c7..1ee6e7e 100644
--- a/pyvoltha/adapters/extensions/kpi/adapter_pm_metrics.py
+++ b/pyvoltha/adapters/extensions/kpi/adapter_pm_metrics.py
@@ -191,7 +191,7 @@
:param data: (list) Existing list of collected metrics (MetricInformation)
to convert to a KPIEvent and publish
"""
- self.log.debug('publish-metrics')
+ self.log.debug('publish-metrics', data=data)
if len(data):
try:
diff --git a/pyvoltha/adapters/extensions/kpi/onu/onu_omci_pm.py b/pyvoltha/adapters/extensions/kpi/onu/onu_omci_pm.py
index 5ef706c..d627ca4 100644
--- a/pyvoltha/adapters/extensions/kpi/onu/onu_omci_pm.py
+++ b/pyvoltha/adapters/extensions/kpi/onu/onu_omci_pm.py
@@ -41,7 +41,7 @@
DEFAULT_UNI_STATUS_ENABLED = True
DEFAULT_UNI_STATUS_FREQUENCY = (15 * 60 * 10)
- def __init__(self, core_proxy, device_id, logical_device_id,
+ def __init__(self, core_proxy, device_id, logical_device_id, serial_number,
grouped=False, freq_override=False, **kwargs):
"""
Initializer for shared ONU Device Adapter OMCI CC PM metrics
@@ -60,7 +60,7 @@
retrieval of OpenOMCI Communications channel statistics
and retrieval of polled statistics.
"""
- super(OnuOmciPmMetrics, self).__init__(core_proxy, device_id, logical_device_id,
+ super(OnuOmciPmMetrics, self).__init__(core_proxy, device_id, logical_device_id, serial_number,
grouped=grouped, freq_override=freq_override,
**kwargs)
@@ -108,7 +108,8 @@
self.omci_uni_metrics_config = {m: PmConfig(name=m, type=t, enabled=True)
for (m, t) in self.omci_uni_pm_names}
- self.openomci_interval_pm = OnuPmIntervalMetrics(core_proxy, device_id, logical_device_id)
+ self.openomci_interval_pm = OnuPmIntervalMetrics(core_proxy, device_id, logical_device_id,
+ serial_number)
def update(self, pm_config):
# TODO: Test frequency override capability for a particular group
diff --git a/pyvoltha/adapters/extensions/kpi/onu/onu_pm_interval_metrics.py b/pyvoltha/adapters/extensions/kpi/onu/onu_pm_interval_metrics.py
index 5353f1b..45b9ca2 100644
--- a/pyvoltha/adapters/extensions/kpi/onu/onu_pm_interval_metrics.py
+++ b/pyvoltha/adapters/extensions/kpi/onu/onu_pm_interval_metrics.py
@@ -56,8 +56,8 @@
XGPON_DOWNSTREAM_HISTORY = False
XGPON_UPSTREAM_HISTORY = False
- def __init__(self, core_proxy, device_id, logical_device_id, **kwargs):
- super(OnuPmIntervalMetrics, self).__init__(core_proxy, device_id, logical_device_id,
+ def __init__(self, core_proxy, device_id, logical_device_id, serial_number, **kwargs):
+ super(OnuPmIntervalMetrics, self).__init__(core_proxy, device_id, logical_device_id, serial_number,
grouped=True, freq_override=False,
**kwargs)
ethernet_bridge_history = {
diff --git a/pyvoltha/adapters/extensions/kpi/onu/onu_pm_metrics.py b/pyvoltha/adapters/extensions/kpi/onu/onu_pm_metrics.py
index eaf0232..3d6fd42 100644
--- a/pyvoltha/adapters/extensions/kpi/onu/onu_pm_metrics.py
+++ b/pyvoltha/adapters/extensions/kpi/onu/onu_pm_metrics.py
@@ -35,7 +35,7 @@
# the KPI shared library supports individual collection.
DEFAULT_ONU_COLLECTION_FREQUENCY = 60 * 10 # 1 minute
- def __init__(self, core_proxy, device_id, logical_device_id,
+ def __init__(self, core_proxy, device_id, logical_device_id, serial_number,
grouped=False, freq_override=False, **kwargs):
"""
Initializer for shared ONU Device Adapter PM metrics
@@ -53,7 +53,7 @@
'heartbeat': Reference to the a class that provides an ONU heartbeat
statistics. TODO: This should be standardized across adapters
"""
- super(OnuPmMetrics, self).__init__(core_proxy, device_id, logical_device_id,
+ super(OnuPmMetrics, self).__init__(core_proxy, device_id, logical_device_id, serial_number,
grouped=grouped, freq_override=freq_override,
**kwargs)
@@ -77,7 +77,7 @@
self.health_metrics_config = {m: PmConfig(name=m, type=t, enabled=True)
for (m, t) in self.health_pm_names}
- self.omci_pm = OnuOmciPmMetrics(core_proxy, device_id, logical_device_id,
+ self.omci_pm = OnuOmciPmMetrics(core_proxy, device_id, logical_device_id, serial_number,
grouped=grouped, freq_override=freq_override,
**kwargs)