summaryrefslogtreecommitdiffstats
path: root/doc/TRexDataAnalysisV2.py
diff options
context:
space:
mode:
Diffstat (limited to 'doc/TRexDataAnalysisV2.py')
-rwxr-xr-xdoc/TRexDataAnalysisV2.py14
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)