diff --git a/parsl/jobs/strategy.py b/parsl/jobs/strategy.py index 02af4dc207..032ba16d8c 100644 --- a/parsl/jobs/strategy.py +++ b/parsl/jobs/strategy.py @@ -3,12 +3,11 @@ import time import math import warnings -from typing import Dict, List, Optional +from typing import Dict, List, Optional, TypedDict import parsl.jobs.job_status_poller as jsp from parsl.executors import HighThroughputExecutor -from parsl.executors.base import ParslExecutor from parsl.executors.status_handling import BlockProviderExecutor from parsl.jobs.states import JobState from parsl.process_loggers import wrap_with_logs @@ -17,6 +16,16 @@ logger = logging.getLogger(__name__) +class ExecutorState(TypedDict): + """Strategy relevant state for an executor + """ + + idle_since: Optional[float] + """The timestamp at which an executor became idle. + If the executor is not idle, then None. + """ + + class Strategy: """Scaling strategy. @@ -115,7 +124,7 @@ class Strategy: def __init__(self, *, strategy: Optional[str], max_idletime: float): """Initialize strategy.""" - self.executors: Dict[str, ParslExecutor] + self.executors: Dict[str, ExecutorState] self.executors = {} self.max_idletime = max_idletime