summaryrefslogtreecommitdiff
path: root/executors.py
diff options
context:
space:
mode:
authorScott <[email protected]>2022-01-24 15:42:09 -0800
committerScott <[email protected]>2022-01-24 15:42:09 -0800
commit4e9d232d46b2a99adbee9a288884666063f649a0 (patch)
tree7fe171f6ed6e3429543641b3ee3d617e4297a3d1 /executors.py
parent0ae7375a650b06e303eb523a7ab47730ec7308a1 (diff)
Report overall runtime in periodic status dumps.
Diffstat (limited to 'executors.py')
-rw-r--r--executors.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/executors.py b/executors.py
index e092e10..dcc2180 100644
--- a/executors.py
+++ b/executors.py
@@ -248,8 +248,9 @@ class BundleDetails:
class RemoteExecutorStatus:
def __init__(self, total_worker_count: int) -> None:
- self.worker_count = total_worker_count
+ self.worker_count: int = total_worker_count
self.known_workers: Set[RemoteWorkerRecord] = set()
+ self.start_time: float = time.time()
self.start_per_bundle: Dict[str, float] = defaultdict(float)
self.end_per_bundle: Dict[str, float] = defaultdict(float)
self.finished_bundle_timings_per_worker: Dict[
@@ -259,11 +260,11 @@ class RemoteExecutorStatus:
self.bundle_details_by_uuid: Dict[str, BundleDetails] = {}
self.finished_bundle_timings: List[float] = []
self.last_periodic_dump: Optional[float] = None
- self.total_bundles_submitted = 0
+ self.total_bundles_submitted: int = 0
# Protects reads and modification using self. Also used
# as a memory fence for modifications to bundle.
- self.lock = threading.Lock()
+ self.lock: threading.Lock = threading.Lock()
def record_acquire_worker(self, worker: RemoteWorkerRecord, uuid: str) -> None:
with self.lock:
@@ -338,13 +339,14 @@ class RemoteExecutorStatus:
if len(self.finished_bundle_timings) > 1:
qall = numpy.quantile(self.finished_bundle_timings, [0.5, 0.95])
ret += (
- f'⏱=∀p50:{qall[0]:.1f}s, ∀p95:{qall[1]:.1f}s, '
+ f'⏱=∀p50:{qall[0]:.1f}s, ∀p95:{qall[1]:.1f}s, total={ts-self.start_time:.1f}s, '
f'✅={total_finished}/{self.total_bundles_submitted}, '
f'💻n={total_in_flight}/{self.worker_count}\n'
)
else:
ret += (
- f' ✅={total_finished}/{self.total_bundles_submitted}, '
+ f'⏱={ts-self.start_time:.1f}s, '
+ f'✅={total_finished}/{self.total_bundles_submitted}, '
f'💻n={total_in_flight}/{self.worker_count}\n'
)