Realistic telemetry data generators for benchmarks and testing.
Generates node_exporter-compatible metric names and values that produce realistic compression patterns:
- Gauges: oscillate around a base with drift and noise
- Counters: monotonically increase with variable increments
- Constants: rarely change (filesystem size, boot time, etc.)
Usage
# Generate a list of metric definitions
metrics = TimelessMetrics.DataGenerator.metrics()
# Generate a value for a specific metric at a given timestamp
val = TimelessMetrics.DataGenerator.value("node_load1", ts_ms, device_id)
# Generate a full scrape payload (all metrics for one device)
points = TimelessMetrics.DataGenerator.scrape(:metrics, device_id, timestamp)
Summary
Functions
Return the number of metrics per device.
Return the list of metric names.
Generate count time series points for a single metric + device.
Generate a Prometheus text exposition body for one device scrape.
Generate a realistic value for a metric at a given timestamp and device.
Generate a list of {metric_name, labels, value} tuples for one device.
Functions
Return the number of metrics per device.
Return the list of metric names.
Generate count time series points for a single metric + device.
Returns [{timestamp, value}, ...] sorted by timestamp.
Useful for compression benchmarks.
Generate a Prometheus text exposition body for one device scrape.
Returns a string with one line per metric, ready to POST to
/api/v1/import/prometheus.
Generate a realistic value for a metric at a given timestamp and device.
Uses deterministic hashing so the same (metric, ts, device) always produces the same value — reproducible benchmarks.
Generate a list of {metric_name, labels, value} tuples for one device.
Ready to pass to TimelessMetrics.write_batch/2.