stormlog.infer.arrivals
Arrival schedules for inference profiling workloads.
A closed loop sends the next request when a worker’s previous request finishes, so the server’s speed sets the offered load. The open-loop modes here fix when each request is meant to arrive before the run starts, so a slow server builds a queue instead of slowing the traffic down.
Functions
|
Return when each request should arrive, in seconds from phase start. |
|
Read arrival offsets from a trace or from a Stormlog inference artifact. |
|
When an open-loop schedule's observation window ends, from phase start. |
Classes
|
How the requests of one workload case arrive. |
|
Recorded arrival offsets to replay, with where they came from. |
- class stormlog.infer.arrivals.ArrivalTrace(offsets_seconds, source, case_id=None)[source]
Bases:
objectRecorded arrival offsets to replay, with where they came from.
- Parameters:
offsets_seconds (tuple[float, ...])
source (str)
case_id (str | None)
- offsets_seconds: tuple[float, ...]
- source: str
- case_id: str | None = None
- class stormlog.infer.arrivals.ArrivalSpec(mode='closed', rate_per_second=None, burst_size=None, burst_interval_seconds=None, trace=None)[source]
Bases:
objectHow the requests of one workload case arrive.
- Parameters:
mode (str)
rate_per_second (float | None)
burst_size (int | None)
burst_interval_seconds (float | None)
trace (ArrivalTrace | None)
- mode: str = 'closed'
- rate_per_second: float | None = None
- burst_size: int | None = None
- burst_interval_seconds: float | None = None
- trace: ArrivalTrace | None = None
- property open_loop: bool
- stormlog.infer.arrivals.arrival_offsets(spec, *, count, duration_seconds, seed)[source]
Return when each request should arrive, in seconds from phase start.
The first request arrives at 0.
countcaps the number of arrivals andduration_secondskeeps only arrivals before the window closes; a replay without either sends the whole trace.- Parameters:
spec (ArrivalSpec)
count (int | None)
duration_seconds (float | None)
seed (int)
- Return type:
list[float]
- stormlog.infer.arrivals.scheduled_endpoint(spec, *, count, duration_seconds, seed)[source]
When an open-loop schedule’s observation window ends, from phase start.
A duration-limited schedule ends at its duration. A count-limited one ends at the first offset of the unbounded schedule strictly after its last arrival, one whole slot after it: N fixed-rate arrivals at r per second span N/r seconds, and a Poisson count gives the usual N/T_N rate. Ending at the last arrival instead would report 2 requests at 10/s as 20/s. A replay has no slot after its trace, so without a duration it has no end (None), and neither does a closed loop.
- Parameters:
spec (ArrivalSpec)
count (int | None)
duration_seconds (float | None)
seed (int)
- Return type:
float | None
- stormlog.infer.arrivals.load_arrival_trace(path, *, case_id=None)[source]
Read arrival offsets from a trace or from a Stormlog inference artifact.
A trace has one JSON object per line with
offset_ms. An inference artifact contributes the measured requests of one case: their intended arrival times when recorded, otherwise the times they were sent.- Parameters:
path (str | Path)
case_id (str | None)
- Return type: