Use Cases

tflo is a temporal event processing engine: model your domain events, and it turns the noisy stream into clean lifecycle events — appeared, persisted, changed, dropped out, crossed a threshold. The same computation graph runs on static data and live streams: develop against a Vec of historical events, then deploy the exact same logic against a live Kafka topic — no code changes.

📡

RF Spectrum Monitoring

The Problem

A receiver pours out a noisy stream of detections — energy at a frequency, a bearing, a power level — many of them spurious. You need to know when a signal appears, how long it persists, when its bearing or range-rate changes, and when it drops out. That is a lifecycle, not a row in a table. Hand-rolling the de-bounce, hysteresis, and per-emitter state is where the bugs live.

How tflo Helps

  • Lifecycle events — noisy detections in; appeared / persisted / changed / dropped-out events out.
  • Keyed execution — one graph definition, independent state per emitter or frequency bin.
  • Glitch and runt detectors — reject transient energy that never becomes a real track.
  • Rate-of-change and direction detection — Doppler range-rate, bearing-change alerts via rate_of_change and cross detectors.
  • Checkpoint to S3 — crash recovery without replaying the capture from the start.
🛡

Intrusion & Anomaly Detection

The Problem

Security and fraud telemetry arrives as a firehose of low-level events: connections, logins, transactions. Any single event is meaningless — what matters is a sustained pattern: a slow rise in failed logins, a transaction rate that crosses a baseline, a host that suddenly behaves unlike its peers. You need stateful, per-entity correlation, not a stateless rule on one record.

How tflo Helps

  • Keyed by entity — per source IP, per account, per host, each with its own window state.
  • Threshold-cross events — fire when a rate or z-score crosses a learned baseline.
  • Pulse and hysteresis detectors — require a pattern to persist before alerting; suppress single-event noise.
  • Policy filters — express detection rules in CEL, Rhai, or Rego and update them without recompiling.
🏭

IoT & Sensor Monitoring

The Problem

Thousands of sensors reporting temperature, pressure, vibration, humidity. You need running statistics per device, anomaly detection, and the ability to distinguish real events from transient glitches. Database queries and batch jobs miss the real-time window.

How tflo Helps

  • Per-device state via keyed execution — each sensor ID gets its own window.
  • Running statistics — mean, variance, standard deviation, z-score, all updated online.
  • Glitch detector — rejects transient spikes that revert within a configurable window.
  • Pulse detector — fires when a value stays above threshold for a minimum duration.
  • Async-native — integrates directly into Tokio-based ingestion pipelines.
📉

Signal Processing & Oscilloscope Pipelines

The Problem

Audio, radar, radio, and other waveform data streams at high sample rates. You need envelope detection, running statistics, and pattern recognition without buffering the entire signal. Many DSP tools are batch-oriented or require manual buffer management.

How tflo Helps

  • Streaming window primitives — duration-based and count-based windows over any iterator or stream.
  • Running moments — mean, variance, stddev, correlation, and median over sliding windows.
  • Pattern and slope detectors — custom pattern matching and rate-of-change detection.
  • Zero-copy keyed execution — process multiple channels independently without per-channel buffering.

Edge Computing & Embedded

The Problem

Running analytics close to the source means tight CPU and memory budgets. You can’t ship a Python runtime with NumPy to a Raspberry Pi or an industrial gateway. You need Rust-level performance and minimal allocations.

How tflo Helps

  • Works on Iterator, no async required — use .tflo() on a bare Vec iterator for embedded use.
  • Compiled graph — build once, feed data repeatedly. No per-tick allocation overhead.
  • Minimal footprint — pull in only tflo-core for the engine; add crates as needed.
  • File-based checkpointing — survive power cycles with local flash persistence.
🔭

Observability & Infrastructure Monitoring

The Problem

Latency percentiles, error rates, throughput, and saturation metrics stream in from hundreds of services. The hardest part isn’t the threshold — it’s the flapping: an alert that fires, clears, and re-fires every few seconds as a metric jitters around its limit. De-flapping is a hysteresis problem, and most alerting stacks don’t model it.

How tflo Helps

  • Hysteresis detector — separate arm/disarm thresholds turn a flapping metric into one clean crossed event.
  • Running statistical nodes — mean, variance, z-score over sliding windows.
  • Window and pulse detectors — alert only when a metric stays in a band for a minimum duration.
  • Rego policy integration — define alert policies in OPA/Rego via tflo-rego and evaluate them inline.
  • Async streaming — ingest directly from Kafka, gRPC streams, or WebSocket feeds.
📆

Sparse & Irregular Time-Series Data

The Problem

Most real-world time-series data is not evenly sampled. Clinical measurements happen on clinic visit days, not every Tuesday at 2pm. Real estate transactions close when they close. Ecological field data arrives when a researcher visits the site. Traditional tools force you to resample, interpolate, or pad — distorting the signal before you even start analyzing.

How tflo Helps

  • Duration-based windows, not count-based30_u64.days() means the last 30 days of data, regardless of how many points arrived.
  • No resampling required — timestamps determine window membership. Gaps in data are gaps; tflo doesn’t invent fill values.
  • Keyed by entity — track each patient, property, or study site independently with its own irregular cadence.
  • Same graph, any data density — works identically whether you have 3 points per year or 10,000 per second.
🏥

Clinical Trials & Healthcare

Patients visit on irregular schedules. Key by patient ID. Track running mean and stddev of lab values over a rolling 90-day window. Slope-detect a sustained rise in liver enzymes or a drop in platelet count. Pulse-detect fever episodes lasting > 48 hours. No interpolation needed — the window respects actual timestamps.

🏠

Real Estate & Housing Markets

Transactions are sparse and clustered by season. Key by ZIP code or neighborhood. Compute a 6-month EMA of price-per-sqft. Cross-detect when median days-on-market drops below a 2-year baseline. Trend changes emerge from duration windows that span dozens or hundreds of days, not a fixed transaction count.

🔬

Scientific & Field Research

Ecology surveys, astronomy transients, seismology events, climate sensor networks. Irregular visits, bursty detections, gappy telemetry. Duration windows match the natural cadence of the domain. Running statistics across seasonal windows. Glitch-filter instrument noise. Pattern-detect across uneven observation intervals.

📝

Log Analysis & Uptick Detection

The Problem

Logs stream in from dozens of services. Buried in the noise are upticks that matter: a spike in 5xx errors after a deploy, a sudden increase in database timeouts, a wave of auth failures that might be a credential attack. Dashboards show you the current count; they don’t tell you the rate of change or whether a burst is a real trend or a statistical blip.

How tflo Helps

  • Count-per-window indicators — treat log event counts as a time series; compute SMA, EMA, and z-score over sliding windows.
  • Pulse detection — fire when error rate stays above threshold for a minimum duration; ignore single-event noise.
  • Slope detection — alert when the rate of increase exceeds a configurable threshold, not just a static count.
  • Keyed by log type — track 5xx, 4xx, timeout, and auth-failure trends independently in one graph.

5xx Error Uptick After Deploy

Treat per-minute 5xx count as a property. Compute a z-score over a 10-minute baseline. Pulse-detect when z-score > 3 for at least 2 consecutive minutes. Fire a rollback alert before users notice.

Database Timeout Wave

Key by error type (db_timeout, db_conn_refused). Compute a 5-minute EMA of timeout count. Cross-detect when the EMA exceeds the 95th percentile of the previous hour. Distinguish gradual degradation from a sudden pool exhaustion.

Credential Attack Detection

Key by auth_failure per source IP. Slope-detect a sustained increase in failure rate (not just a high absolute count). Combine with a glitch filter to ignore a single user who fat-fingered their password three times.

See it in action

Head to the Quick Start guide and have a streaming SMA running in under 5 minutes.