swh.scheduler.simulator package#
Submodules#
- swh.scheduler.simulator.common module
SimulationReportSimulationReport.DURATION_THRESHOLDSimulationReport.total_visitsSimulationReport.visit_runtimesSimulationReport.scheduler_metricsSimulationReport.visit_metricsSimulationReport.latest_snapshotsSimulationReport.record_visit()SimulationReport.record_metrics()SimulationReport.uneventful_visitsSimulationReport.runtime_histogram()SimulationReport.metrics_plot()SimulationReport.metrics_csv()SimulationReport.format()
TaskTaskEventQueueEnvironment
- swh.scheduler.simulator.origin_scheduler module
- swh.scheduler.simulator.origins module
- swh.scheduler.simulator.task_scheduler module
Module contents#
This package runs the scheduler in a simulated environment, to evaluate various metrics. See Software Heritage Scheduler Simulator.
This module orchestrates of the simulator by initializing processes and connecting them together; these processes are defined in modules in the package and simulate/call specific components.
- swh.scheduler.simulator.update_metrics_process(env: Environment, update_interval: int) Generator[Event, None, None][source]#
Update the scheduler metrics every update_interval (simulated) seconds, and add them to the SimulationReport
- swh.scheduler.simulator.worker_process(env: Environment, name: str, task_queue: Queue, status_queue: Queue) Generator[Event, Task, None][source]#
A worker which consumes tasks from the input task_queue. Tasks themselves send OriginVisitStatus objects to the status_queue.
- swh.scheduler.simulator.setup(env: Environment, scheduler_type: str, policy: str | None, workers_per_type: Dict[str, int], task_queue_capacity: int, min_batch_size: int, metrics_update_interval: int)[source]#
- swh.scheduler.simulator.fill_test_data(scheduler: SchedulerInterface, num_origins: int = 100000)[source]#
Fills the database with mock data to test the simulator.