| 338 | |
| 339 | |
| 340 | class ScriptSummary: |
| 341 | def __init__(self, op: str): |
| 342 | self.start = time.time() |
| 343 | self.update = time.time() |
| 344 | self.op = op |
| 345 | self.time = {} |
| 346 | |
| 347 | def record(self, script): |
| 348 | now = time.time() |
| 349 | self.time[script] = round(now - self.update, 2) |
| 350 | self.update = now |
| 351 | |
| 352 | def report(self): |
| 353 | total = sum(self.time.values()) |
| 354 | if total == 0: |
| 355 | return |
| 356 | scripts = [f'{k}:{v}' for k, v in self.time.items() if v > 0] |
| 357 | log.debug(f'Script: op={self.op} total={total} scripts={scripts}') |
| 358 | |
| 359 | |
| 360 | class ScriptRunner: |
no outgoing calls
no test coverage detected