diff options
author | itraviv <itraviv@cisco.com> | 2017-01-12 18:27:38 +0200 |
---|---|---|
committer | itraviv <itraviv@cisco.com> | 2017-01-12 18:27:38 +0200 |
commit | 1f20bc40d85e559edd4de8fd53f48697aa484ce5 (patch) | |
tree | b1ea33c8d1b3905818653786b9b358739fa8898d /doc | |
parent | 8efde3503c07562a00b36cec4ee0dec1d2a89127 (diff) |
fixed missing-information issue when presenting time.
Signed-off-by: itraviv <itraviv@cisco.com>
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/TRexDataAnalysisV2.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/doc/TRexDataAnalysisV2.py b/doc/TRexDataAnalysisV2.py index 28894ea2..f154efbe 100755 --- a/doc/TRexDataAnalysisV2.py +++ b/doc/TRexDataAnalysisV2.py @@ -2,10 +2,14 @@ import pandas as pd
import numpy as np
import matplotlib
+
matplotlib.use('Agg')
from matplotlib import pyplot as plt
+from matplotlib import dates as matdates
+from matplotlib import lines as matlines
import os
import time
+from datetime import datetime
"""
This Module is structured to work with a raw data at the following JSON format:
@@ -124,8 +128,14 @@ class Setup: self.all_tests_data_table = reduce(lambda x, y: pd.merge(x, y, how='outer'), all_tests_trend_data)
def plot_trend_graph_all_tests(self, save_path='', file_name='_trend_graph.png'):
- for test_name in self.test_names:
- self.all_tests_data_table[test_name].plot(style=['.-'])
+ time_format = '%d-%m-%Y-%H:%M'
+ for test in self.tests:
+ test_data = test.results_df[test.results_df.columns[2]].tolist()
+ test_time_stamps = test.results_df[test.results_df.columns[3]].tolist()
+ test_time_stamps.append(self.end_date+'-23:59')
+ test_data.append(test_data[-1])
+ float_test_time_stamps = [matdates.date2num(datetime.strptime(x, time_format)) for x in test_time_stamps]
+ plt.plot_date(x=float_test_time_stamps, y=test_data, label=test.name, fmt='-', xdate=True)
plt.legend(fontsize='small', loc='best')
plt.ylabel('MPPS/Core (Norm)')
plt.title('Setup: ' + self.name)
|