Skip to content

Commit

Permalink
Include Interface Index As Dimension
Browse files Browse the repository at this point in the history
  • Loading branch information
road-cycling committed May 14, 2020
1 parent 59b0403 commit 1b556c1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/plugins/helpers.py
Expand Up @@ -362,7 +362,7 @@ def test_enrichment_plugin_results(self):
result = plugin.run(self._plugin_context)

self.assertIsNotNone(result)

print(result.json())
result = ordered(json.loads(result.json()))
expected = ordered(self._expected_results)

Expand Down Expand Up @@ -417,6 +417,9 @@ def test_basic_operations(self):

plugin = self.plugin_class()
results = plugin.run(self._plugin_context)
print(self._remove_timestamps(results))
print()


self.assertEqual(ordered(self._expected_results), ordered(self._remove_timestamps(results)))

Expand Down
4 changes: 4 additions & 0 deletions tests/plugins/polling/interface/data/results.json
Expand Up @@ -5,6 +5,10 @@
"dimension_name": "parent_interface_media_type",
"dimension_value": "<not set>"
},
{
"dimension_name": "interface_index",
"dimension_value": "5"
},
{
"dimension_name": "alias",
"dimension_value": "Gi0"
Expand Down
Expand Up @@ -67,6 +67,7 @@ def __init__(self):
self._ifx_table_stats_map = None

self._DIMENSION_MAP = {
u'interface_index': lambda x: str(x),
u'alias': self.get_alias,
u'media_type': self.get_media_type,
u'description': self.get_description,
Expand Down Expand Up @@ -328,6 +329,7 @@ def _smart_add_dimension(self, method, dimension_name, index):
_DEFAULT_DIMENSION_VALUE))

def get_results(self):

self._polling_status = PanoptesPollingStatus(resource=self.resource,
execute_frequency=self.execute_frequency,
logger=self.logger,
Expand Down

0 comments on commit 1b556c1

Please sign in to comment.