diff options
Diffstat (limited to 'storperf/utilities')
-rw-r--r-- | storperf/utilities/data_handler.py | 2 | ||||
-rw-r--r-- | storperf/utilities/math.py | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/storperf/utilities/data_handler.py b/storperf/utilities/data_handler.py index e38f502..a4c9ae4 100644 --- a/storperf/utilities/data_handler.py +++ b/storperf/utilities/data_handler.py @@ -125,7 +125,7 @@ class DataHandler(object): for item in series: elapsed = (item[0] - start_time) - sample_number = (elapsed / 60) + 1 + sample_number = int(round(float(elapsed) / 60)) normalized_series.append([sample_number, item[1]]) return normalized_series diff --git a/storperf/utilities/math.py b/storperf/utilities/math.py index 4ddddca..8e04134 100644 --- a/storperf/utilities/math.py +++ b/storperf/utilities/math.py @@ -6,6 +6,7 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +import copy def slope(data_series): @@ -20,7 +21,7 @@ def slope(data_series): [[x1,y1], [x2,y2], ..., [xm,ym]]. If this data pattern were to change, the data_treatement function should be adjusted to ensure compatibility with the rest of the - Steady State Dectection module. + Steady State Detection module. """ # In the particular case of an empty data series @@ -28,6 +29,7 @@ def slope(data_series): beta2 = None else: # The general case + data_series = copy.deepcopy(data_series) m = len(data_series) # To make sure at least one element is a float number so the result # of the algorithm be a float number |