Power class knows nothing about actual delta_t in outputs

This commit is contained in:
Jose Gracia 2024-02-12 16:29:25 +01:00
parent ff7da8b8a2
commit fa1f981f89

View file

@ -31,12 +31,11 @@ def parse_jobid(s):
class Power:
def __init__(self, nodes, interval=-1):
def __init__(self, nodes):
self.nodes = nodes
self.epochs = OrderedDict()
self.first_ts = None
self.last_ts = None
self.interval = interval
@classmethod
def from_list(cls, data):
@ -68,7 +67,6 @@ class Power:
raise RuntimeError
power = cls.from_list(all_list)
power.set_interval(interval*1000) # milliseconds
return power
@ -89,9 +87,6 @@ class Power:
return fname
def set_interval(self, interval):
self.interval = interval
def insert_epoch(self, ts, values):
self.epochs[ts] = values
if not self.first_ts:
@ -101,7 +96,7 @@ class Power:
def header(self):
hd = "# all timestamp have unit miliseconds since unix epoch\n"
hd += "# all power values have unit Watt\n"
hd += "timestamp,delta_t,head_node_power,avg_node_power,median_node_power,min_node_power,max_node_power,std_dev_node_power"
hd += "timestamp,RESERVED,head_node_power,avg_node_power,median_node_power,min_node_power,max_node_power,std_dev_node_power"
# add node names here instead
hd += ",NO_NODE_NAMES_YET\n"
return hd
@ -113,7 +108,7 @@ class Power:
return _body
def summarize_time(self, ts):
return ts, self.interval
return ts, ""
@staticmethod
def summarize_values(val):