diff options
author | Emma Foley <emma.l.foley@intel.com> | 2018-12-18 18:26:23 +0000 |
---|---|---|
committer | Emma Foley <emma.l.foley@intel.com> | 2019-02-11 11:53:27 +0000 |
commit | 4ac123951f5571d44ec01b680941b95203653c64 (patch) | |
tree | c489ccc1bcaab40a3da1a894dc645bca174b7156 /yardstick | |
parent | 0738c2544e3220a3e0fd80a77ab1f2800f90533e (diff) |
Add ability to get data from different DBs in influx
In order to get data from Barometer, the influx helper need
to be updated to recognise different DBs. This patch adds
an optional arg to specify which database to use.
By default, the configured dispatcher for Yardstick is
used.
Limitation: The new change hard codes barometer DB name to
be used, and assumes that it is in the same instance of
Influx as the Yardstick dispatcher.
This can be extended later to make it configurable,
however, a new config option would have to be introduced.
JIRA: YARDSTICK-1593
Change-Id: Idee9c3491d6bf7b549e014edd9ff031312cf0ec2
Signed-off-by: Emma Foley <emma.l.foley@intel.com>
Diffstat (limited to 'yardstick')
-rw-r--r-- | yardstick/tests/unit/apiserver/utils/test_influx.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/yardstick/tests/unit/apiserver/utils/test_influx.py b/yardstick/tests/unit/apiserver/utils/test_influx.py index 6021d35df..3a97ff292 100644 --- a/yardstick/tests/unit/apiserver/utils/test_influx.py +++ b/yardstick/tests/unit/apiserver/utils/test_influx.py @@ -1,5 +1,6 @@ ############################################################################## # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others. +# Copyright (c) 2019 Intel Corporation. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 @@ -29,7 +30,7 @@ class GetDataDbClientTestCase(base.BaseUnitTestCase): self.assertEqual('fake_client', influx.get_data_db_client()) _mock_parser.read.assert_called_once_with(constants.CONF_FILE) - mock_get_client.assert_called_once_with(_mock_parser) + mock_get_client.assert_called_once_with(_mock_parser, None) @mock.patch.object(influx.logger, 'error') @mock.patch.object(influx, '_get_influxdb_client', @@ -46,7 +47,7 @@ class GetDataDbClientTestCase(base.BaseUnitTestCase): influx.get_data_db_client() _mock_parser.read.assert_called_once_with(constants.CONF_FILE) - mock_get_client.assert_called_once_with(_mock_parser) + mock_get_client.assert_called_once_with(_mock_parser, None) class GetIpTestCase(base.BaseUnitTestCase): |