diff --git a/monitoring/db/scripts/get_detailed_power.py b/monitoring/db/scripts/get_detailed_power.py index 55a606e..60b8232 100644 --- a/monitoring/db/scripts/get_detailed_power.py +++ b/monitoring/db/scripts/get_detailed_power.py @@ -37,7 +37,6 @@ class Power: nodes = list(set([line[2] for line in data])) cls = Power(nodes) - # for now ignore order to nodes values = {} for l in data: @@ -62,7 +61,6 @@ class Power: return Power.from_list(all_list) - def to_file(self, jobid): """Dumps power data to file. Returns filename is succesfull and None if unsucessfull.""" fname = self.filename(jobid) @@ -130,6 +128,7 @@ class Power: ) return fname + class MonitoringDB: def __init__(self, verbose): self.connection = self.init_db(verbose) @@ -185,6 +184,7 @@ class MonitoringDB: query = self.build_query(jobid, interval) return pd.read_sql(query, con=self.connection) + class App: def __init__(self, config): self.config = config @@ -197,7 +197,7 @@ class App: except RuntimeError: print('No data found for job ID "{}"'.format(jobid)) continue - + fn = power.to_file(jobid) if fn: print('Created file {fn}'.format(fn=fn)) @@ -210,19 +210,3 @@ if __name__ == "__main__": main = App(config) main.run_all() - #power = Power.from_db(DB, config.jobid, config.interval) - #print("#epochs", len(power.epochs)) - # - #print(power.header()) - # - #epochs_iter = iter(power.epochs.items()) - #ts, values = next(epochs_iter) - #print(ts, values) - #print('time:', power.summarize_time(ts)) - #print('values:', power.summarize_values(values)) - #print('epoch:', power.pretty_print(power.summarize_epoch((ts, values)))) - #print("filename: ", power.to_file(config.jobid)) - - - -