config
sqllocks_spindle.streaming.config
¶
Streaming configuration dataclasses for Spindle Phase 2.
Classes¶
BurstWindow
dataclass
¶
A time window where event rate is multiplied by a factor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start_offset_seconds
|
float
|
Seconds from stream start when the burst begins. |
required |
duration_seconds
|
float
|
How long the burst lasts. |
required |
multiplier
|
float
|
Rate multiplier during the burst (e.g. 10.0 = 10x normal rate). |
required |
Example::
# 10x rate burst starting at t=30s, lasting 60 seconds
BurstWindow(start_offset_seconds=30, duration_seconds=60, multiplier=10.0)
TimePattern
dataclass
¶
Time-of-day and day-of-week rate multipliers.
Applied on top of the base rate when simulating real-world temporal patterns. E.g., e-commerce has high traffic 7pm–10pm and lower traffic at 3am.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hour_multipliers
|
dict[int, float]
|
Mapping of hour (0–23) to multiplier. |
dict()
|
dow_multipliers
|
dict[int, float]
|
Mapping of day-of-week (0=Monday … 6=Sunday) to multiplier. |
dict()
|
StreamConfig
dataclass
¶
Configuration for a Spindle streaming run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
events_per_second
|
float
|
Base target throughput. |
10.0
|
duration_seconds
|
float | None
|
Stop after this many wall-clock seconds ( |
None
|
max_events
|
int | None
|
Stop after this many events ( |
None
|
out_of_order_fraction
|
float
|
Fraction of events to reorder (0.0–1.0). |
0.0
|
out_of_order_max_delay_slots
|
int
|
Maximum slot positions an OOO event is delayed. |
10
|
burst_windows
|
list[BurstWindow]
|
List of :class: |
list()
|
time_pattern
|
TimePattern | None
|
Optional :class: |
None
|
label_anomalies
|
bool
|
Keep |
True
|
batch_size
|
int
|
Events per :meth: |
100
|
realtime
|
bool
|
If |
False
|
Methods:¶
get_rate_multiplier(elapsed, wall_hour=0, wall_dow=0)
¶
Return the composite rate multiplier at a given moment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
elapsed
|
float
|
Seconds since stream start. |
required |
wall_hour
|
int
|
Current wall-clock hour (0–23). |
0
|
wall_dow
|
int
|
Current wall-clock day-of-week (0=Monday). |
0
|