Skip to main content

Module feed

Module feed 

Source
Expand description

Live feed support: reading NDJSON targets from stdin for feed-based measurements.

Structs§

FeedOrigin
Per-origin properties the feed parser needs to validate targets.
FeedOrigins
The configured origins available to feed targets, and the default origins for each IP version.
FeedStream
Wraps the feed receiver as a Stream so it can be used as a gRPC streaming request.

Constants§

FEED_CHANNEL_SIZE
Size of the bounded stdin-to-gRPC feed channel (blocks stdin when full).

Functions§

parse_feed_line 🔒
Parse a single feed line into a live target: an NDJSON object (e.g., {"dst":"1.1.1.1","worker":"ams01","origin":2}) or a bare address (e.g., 1.1.1.1).
parse_feed_object 🔒
Parse an NDJSON feed object into a live target carrying its worker selection. Returns None on a malformed object, an unknown worker/origin, or an invalid nprobes/ttl.
parse_nprobes 🔒
Parse nprobes, that specifies the number of probes to send to this target.
parse_origin 🔒
Resolve a feed line’s origin value to an origin ID: an origin ID (number or numeric string) of a configured origin, or "all". A specific origin must match the target’s IP version.
parse_session 🔒
Parse session, a 16-bit session ID (0-65535) tagging this target; replies echo it back so they can be attributed to the submitting session. When set to 0, the target is not attributed to any session (replies are reported with session 0).
parse_ttl 🔒
Parse ttl, the probe TTL used for this target (feed-trace only, 1-255).
parse_worker 🔒
Resolve a feed line’s worker value to the target’s worker_ids: "any" (round-robin, empty list) or "all" (broadcast, [ALL_WORKERS]) sentinels, or a worker ID, hostname, or glob (e.g. us-*) resolved via resolve_workers — a glob yields every matched worker (probed staggered by the worker interval). Returns None (skip the line) on an unknown worker or a glob that matched nothing.
read_stdin_feed
Read target lines from stdin and forward them to the live feed.