Minor fixes

This commit is contained in:
Alban Bronisz 2021-04-07 19:39:38 +02:00
parent 7b9936334c
commit c36429f3df
1 changed files with 2 additions and 1 deletions

View File

@ -59,12 +59,13 @@ def load_data(stats_fn: str):
for t_i, stat in enumerate(data):
for field in stat:
if field == "date": # date
date_ = stat[field].replace("+01:00", "+0000")
date_ = stat[field].replace("+01:00", "+0000").replace("+02:00", "+0200")
data_dict[field][t_i] = datetime.strptime(date_, "%Y-%m-%dT%H:%M:%S%z")
else: # float
value = stat[field].split(" ")[0]
value = value.replace("MiB", "e3")
value = value.replace("GiB", "e6")
value = value.replace("B", "")
data_dict[name_from_field(field)][t_i] += float(value) / 1000 # values are in MiB
return data_dict