Expand description
Live feed support: reading NDJSON targets from stdin for feed-based measurements.
Structs§
- Feed
Origin - Per-origin properties the feed parser needs to validate targets.
- Feed
Origins - The configured origins available to feed targets, and the default origins for each IP version.
- Feed
Stream - Wraps the feed receiver as a
Streamso 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
Noneon 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
originvalue 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
workervalue to the target’sworker_ids:"any"(round-robin, empty list) or"all"(broadcast,[ALL_WORKERS]) sentinels, or a worker ID, hostname, or glob (e.g.us-*) resolved viaresolve_workers— a glob yields every matched worker (probed staggered by the worker interval). ReturnsNone(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.