\r
["syn attack - 64 bytes, single CPU", "stl", "20161226", "01", "39", "9.631898", "9.5", "11.5", "54289"]\r
\r
- it can be changed to support other formats of queries, simply change the enum class to support your desired structure\r
- the enums specify the indexes of the data within the query tuple\r
+ it can be changed to support other formats of queries, simply change the query class to support your desired structure\r
+ the query class specify the indexes of the data within the query tuple\r
\r
"""\r
\r
\r
class TestQuery(object):\r
- QUERY_DATE = 2 # date format is yyyymmdd\r
+ query_dateformat = "%Y%m%d" # date format in the query\r
+ QUERY_DATE = 2\r
QUERY_HOUR = 3\r
QUERY_MINUTE = 4\r
QUERY_MPPS_RESULT = 5\r
test_mins = set()\r
test_maxs = set()\r
for query in raw_test_data:\r
- date_formatted = time.strftime("%d-%m-%Y", time.strptime(query[int(TestQuery.QUERY_DATE)], "%Y%m%d"))\r
+ date_formatted = time.strftime("%d-%m-%Y",\r
+ time.strptime(query[int(TestQuery.QUERY_DATE)], TestQuery.query_dateformat))\r
time_of_res = date_formatted + '-' + query[int(TestQuery.QUERY_HOUR)] + ':' + query[\r
int(TestQuery.QUERY_MINUTE)]\r
test_dates.append(time_of_res)\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_time_stamps.append(self.end_date + '-23:59')\r
test_data.append(test_data[-1])\r
float_test_time_stamps = []\r
for ts in test_time_stamps:\r
try:\r
- float_test_time_stamps.append(matdates.date2num(datetime.strptime(ts, time_format1)))\r
+ float_test_time_stamps.append(matdates.date2num(datetime.strptime(ts, time_format1)))\r
except:\r
- float_test_time_stamps.append(matdates.date2num(datetime.strptime(ts, time_format2)))\r
+ float_test_time_stamps.append(matdates.date2num(datetime.strptime(ts, time_format2)))\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