bytewax.connectors.demo
#
Connectors for writing local-first demo dataflows.
Data#
Classes#
- class RandomMetricSource(
- metric_name: str,
- interval: timedelta = timedelta(seconds=0.7),
- count: int = sys.maxsize,
- next_random: Callable[[], float] = lambda : ...,
- Bases:
FixedPartitionedSource
[
Tuple
[
str
,
float
],
_RandomMetricState
]
Demo source that produces an infinite stream of random values.
Emits downstream
(metric_name, val)
2-tuples.If you want to emit multiple different metrics, create multiple
input
steps andmerge
them.Initialization
Init.
- Parameters:
metric_name – To attach to each value.
interval – Emit a value on this cadence. Defaults to every 0.7 seconds.
count – Number of values to generate. Defaults to infinite.
next_random – Callable used to generate the next random value. Defaults to a random
int
between 0 and 10.