import pandas as pd\r
import numpy as np\r
import matplotlib\r
+\r
matplotlib.use('Agg')\r
from matplotlib import pyplot as plt\r
+from matplotlib import dates as matdates\r
+from matplotlib import lines as matlines\r
import os\r
import time\r
+from datetime import datetime\r
\r
"""\r
This Module is structured to work with a raw data at the following JSON format:\r
self.all_tests_data_table = reduce(lambda x, y: pd.merge(x, y, how='outer'), all_tests_trend_data)\r
\r
def plot_trend_graph_all_tests(self, save_path='', file_name='_trend_graph.png'):\r
- for test_name in self.test_names:\r
- self.all_tests_data_table[test_name].plot(style=['.-'])\r
+ time_format = '%d-%m-%Y-%H:%M'\r
+ for test in self.tests:\r
+ test_data = test.results_df[test.results_df.columns[2]].tolist()\r
+ test_time_stamps = test.results_df[test.results_df.columns[3]].tolist()\r
+ test_time_stamps.append(self.end_date+'-23:59')\r
+ test_data.append(test_data[-1])\r
+ float_test_time_stamps = [matdates.date2num(datetime.strptime(x, time_format)) for x in test_time_stamps]\r
+ plt.plot_date(x=float_test_time_stamps, y=test_data, label=test.name, fmt='-', xdate=True)\r
plt.legend(fontsize='small', loc='best')\r
plt.ylabel('MPPS/Core (Norm)')\r
plt.title('Setup: ' + self.name)\r