summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormbeierl <mark.beierl@dell.com>2018-08-16 13:15:47 -0400
committermbeierl <mark.beierl@dell.com>2018-08-16 13:15:47 -0400
commit562e802575abc79598ed2ef58a837a146be644c4 (patch)
tree22014009d01771d4a2ecd6d8647936a621db1274
parent5930150915999fd410d7a2da38723065bcf7c91f (diff)
Fixing series data.opnfv-7.0.stable.RC3
Changes the min and max series to also contain the index to make plotting easier. Change-Id: Ifbb43658338d6389705e7f146fa1ca6e13c202ce Signed-off-by: mbeierl <mark.beierl@dell.com>
-rw-r--r--docker/storperf-master/storperf/utilities/data_handler.py9
-rw-r--r--docker/storperf-master/storperf/utilities/math.py18
-rw-r--r--docker/storperf-master/tests/utilities_tests/math_range_test.py18
3 files changed, 20 insertions, 25 deletions
diff --git a/docker/storperf-master/storperf/utilities/data_handler.py b/docker/storperf-master/storperf/utilities/data_handler.py
index cb662f5..6e87781 100644
--- a/docker/storperf-master/storperf/utilities/data_handler.py
+++ b/docker/storperf-master/storperf/utilities/data_handler.py
@@ -61,6 +61,10 @@ class DataHandler(object):
metrics[metric][io_type]['steady_state'] = steady
metrics[metric][io_type]['series_slope'] = \
math.slope_series(series)
+ metrics[metric][io_type]['series_min'] = \
+ math.min_series(series)
+ metrics[metric][io_type]['series_max'] = \
+ math.max_series(series)
treated_data = DataTreatment.data_treatment(series)
metrics[metric][io_type]['slope'] = \
@@ -70,11 +74,6 @@ class DataHandler(object):
average = math.average(treated_data['average_data'])
metrics[metric][io_type]['average'] = average
- metrics[metric][io_type]['series_min'] = \
- math.min_series(treated_data['range_data'])
- metrics[metric][io_type]['series_max'] = \
- math.max_series(treated_data['range_data'])
-
metrics_key = '%s.%s.%s' % (workload, io_type, metric)
executor.metadata['details']['metrics'][metrics_key] = \
average
diff --git a/docker/storperf-master/storperf/utilities/math.py b/docker/storperf-master/storperf/utilities/math.py
index 601ae37..173c39e 100644
--- a/docker/storperf-master/storperf/utilities/math.py
+++ b/docker/storperf-master/storperf/utilities/math.py
@@ -152,11 +152,14 @@ def min_series(data_series):
"""
new_series = []
- avg = average(data_series)
+ average_series = []
+ for l in data_series:
+ average_series.append(l[1])
+ avg = average(average_series)
low = avg - (avg * RANGE_DEVIATION)
- for _ in data_series:
- new_series.append(low)
+ for index, _ in data_series:
+ new_series.append([index, low])
return new_series
@@ -168,10 +171,13 @@ def max_series(data_series):
"""
new_series = []
- avg = average(data_series)
+ average_series = []
+ for l in data_series:
+ average_series.append(l[1])
+ avg = average(average_series)
high = avg + (avg * RANGE_DEVIATION)
- for _ in data_series:
- new_series.append(high)
+ for index, _ in data_series:
+ new_series.append([index, high])
return new_series
diff --git a/docker/storperf-master/tests/utilities_tests/math_range_test.py b/docker/storperf-master/tests/utilities_tests/math_range_test.py
index 9208fb7..bbbbcf9 100644
--- a/docker/storperf-master/tests/utilities_tests/math_range_test.py
+++ b/docker/storperf-master/tests/utilities_tests/math_range_test.py
@@ -120,23 +120,13 @@ class MathRangeTest(unittest.TestCase):
self.assertEqual(expected, actual)
def test_min_series(self):
- expected = [427.7333333333333,
- 427.7333333333333,
- 427.7333333333333,
- 427.7333333333333,
- 427.7333333333333,
- 427.7333333333333]
- data_series = [5, 351, 847, 2, 1985, 18]
+ expected = [[1, 5.6], [2, 5.6], [3, 5.6], [4, 5.6]]
+ data_series = [[1, 6], [2, 5], [3, 7], [4, 10]]
actual = Range.min_series(data_series)
self.assertEqual(expected, actual)
def test_max_series(self):
- expected = [641.5999999999999,
- 641.5999999999999,
- 641.5999999999999,
- 641.5999999999999,
- 641.5999999999999,
- 641.5999999999999]
- data_series = [5, 351, 847, 2, 1985, 18]
+ expected = [[1, 8.4], [2, 8.4], [3, 8.4], [4, 8.4]]
+ data_series = [[1, 6], [2, 5], [3, 7], [4, 10]]
actual = Range.max_series(data_series)
self.assertEqual(expected, actual)