diff --git a/monitoring/db/scripts/get_detailed_power.py b/monitoring/db/scripts/get_detailed_power.py index 491ccba..6d4a20f 100755 --- a/monitoring/db/scripts/get_detailed_power.py +++ b/monitoring/db/scripts/get_detailed_power.py @@ -204,8 +204,23 @@ class App: self.config = config self.db = MonitoringDB(self.config.verbose) + @staticmethod + def warnings(config): + warn = "" + if config.interval < 5: + warn += '# Warning: interval<5 is very small and may lead to data gaps.' + return warn + def run_all(self): - header = f"# {config.datetime}: {config.cmd}\n#\n" + warnings = self.warnings(self.config) + if warnings: + print(warnings) + + header = f"# {config.datetime}: {config.cmd}\n" + if warnings: + header += f"{warnings}\n" + header += "#\n" + for jobid in self.config.jobid: try: power = Power.from_db(self.db, jobid, self.config.interval)