swh.scheduler.simulator.common module#
- class swh.scheduler.simulator.common.SimulationReport(total_visits: int = 0, visit_runtimes: Dict[Tuple[str, bool], List[float]] = <factory>, scheduler_metrics: List[Tuple[datetime.datetime, List[swh.scheduler.model.SchedulerMetrics]]] = <factory>, visit_metrics: List[Tuple[datetime.datetime, int]] = <factory>, latest_snapshots: Dict[Tuple[str, str], bytes] = <factory>)[source]#
Bases:
object
- DURATION_THRESHOLD = 3600#
Max duration for histograms
- visit_runtimes: Dict[Tuple[str, bool], List[float]]#
Collected visit runtimes for each (status, eventful) tuple
- scheduler_metrics: List[Tuple[datetime, List[SchedulerMetrics]]]#
Collected scheduler metrics
This is a list of couples (timestamp, [SchedulerMetrics,]): the list of scheduler metrics collected at given timestamp.
- record_visit(origin: Tuple[str, str], duration: float, status: str, snapshot=typing.Optional[bytes]) None [source]#
- record_metrics(timestamp: datetime, scheduler_metrics: List[SchedulerMetrics])[source]#
- property uneventful_visits#
Number of uneventful, full visits
- class swh.scheduler.simulator.common.Task(visit_type: str, origin: str, backend_id: uuid.UUID = <factory>)[source]#
Bases:
object
- class swh.scheduler.simulator.common.TaskEvent(task: swh.scheduler.simulator.common.Task, status: swh.model.model.OriginVisitStatus, eventful: bool = False)[source]#
Bases:
object
- status: OriginVisitStatus#
- class swh.scheduler.simulator.common.Queue(env, capacity=inf)[source]#
Bases:
Store
Model a queue of objects to be passed between processes.
- class swh.scheduler.simulator.common.Environment(start_time: datetime)[source]#
Bases:
Environment
- report: SimulationReport#
- scheduler: SchedulerInterface#
- property time#
Get the current simulated wall clock time