diff --git a/monitoring/db/scripts/get_detailed_power.py b/monitoring/db/scripts/get_detailed_power.py index 27c06e0..7f01db8 100755 --- a/monitoring/db/scripts/get_detailed_power.py +++ b/monitoring/db/scripts/get_detailed_power.py @@ -49,19 +49,19 @@ class Power: idx_ts = 0; idx_node = 1; idx_value = 2 nodes = list(OrderedDict.fromkeys([line[idx_node] for line in data])) # preserves order of nodes - cls = Power(nodes) + power = Power(nodes) values = {} for l in data: ts = l[idx_ts] if ts not in values: values[ts] = [] - power = l[idx_value] - values[ts].append(power) + value = l[idx_value] + values[ts].append(value) epochs = values.keys() for epoch in epochs: - cls.insert_epoch(epoch, values[epoch]) + power.insert_epoch(epoch, values[epoch]) # check implicit assumptions: 1) ts/epochs are sorted e = list(epochs) @@ -77,7 +77,7 @@ class Power: print("Warning: Unexpected number of nodes ({actual}/{expected})".format(actual=actual, expected=nnodes)) break - return cls + return power @classmethod def from_db(cls, db, jobid, interval, hawk_ai):