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

arrival_offsets(spec, *, count, ...)

Return when each request should arrive, in seconds from phase start.

load_arrival_trace(path, *[, case_id])

Read arrival offsets from a trace or from a Stormlog inference artifact.

scheduled_endpoint(spec, *, count, ...)

When an open-loop schedule's observation window ends, from phase start.

Classes

ArrivalSpec([mode, rate_per_second, ...])

How the requests of one workload case arrive.

ArrivalTrace(offsets_seconds, source[, case_id])

Recorded arrival offsets to replay, with where they came from.

class stormlog.infer.arrivals.ArrivalTrace(offsets_seconds, source, case_id=None)[source]

Bases: object

Recorded 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
digest()[source]
Return type:

str

class stormlog.infer.arrivals.ArrivalSpec(mode='closed', rate_per_second=None, burst_size=None, burst_interval_seconds=None, trace=None)[source]

Bases: object

How 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
case_label()[source]

Short case-id prefix naming the arrival shape.

Return type:

str

to_record()[source]
Return type:

dict[str, Any]

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. count caps the number of arrivals and duration_seconds keeps 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:

ArrivalTrace