Chronix / Guide Examples Runnable examples covering the embedded API, SQL and PromQL queries, forecasting, anomaly detection, streaming, and the cold tier.On this page
Chronix ships a runnable example for every major feature . CI compiles and runs every one of them on each change, so they cannot drift away from the API they demonstrate.
Run any of them with:
cargo run - p chronix - -example < nam e >
# `cold_tier` needs the object-store feature
cargo run - p chronix - -features object-store - -example cold_tier Example Description basic_usage Open a database, insert data points, and query them back query_and_aggregation Fluent QueryBuilder with aggregation, downsampling, and pruning statistics sql_queries SQL via DataFusion: GROUP BY, window functions, ORDER BY, LIMIT, UDFs promql_queries PromQL instant/range queries: rate(), avg_over_time(), label matching exact_decimals Meter registers a settlement is computed from, beside a 1 s float series: declaring a decimal column's scale, exact sums, and the write that is refused rather than rounded schema_exploration Introspect measurements, tag keys, field keys, columns, and schema registry
Example Description forecast All forecast models: Linear Regression, SES, Holt, Holt-Winters, ARIMA, SARIMA anomaly_detection All anomaly methods: Z-Score, Modified Z-Score, IQR, Dynamic Threshold, Forecast Residual continuous_forecast Continuous forecasting engine with accuracy tracking and automatic refit
Example Description multivariate_analysis Cross-series correlation, multivariate anomaly detection, PCA, and VAR forecasting preprocessing Gap detection, interpolation, smoothing, STL decomposition, resampling
Example Description data_pipeline CDC-driven real-time pipeline with triggers, alerts, streaming anomaly, and forecasting alerting Streaming anomaly detection with threshold-based alerts and cooldown signal_triggers Trigger engine with SQL triggers, delivery routing, and dead-letter queues
Example Description gateway_footprint The small preset under the design partner's workload, printing the process's resident set at each step storage_lifecycle Manual flush, compaction, rollup materialisation, and retention enforcement backup_and_restore Take a checkpoint, verify it without restoring it, delete the original, and restore onto a fresh directory delete_operations Tombstone-based deletes, predicate deletes, and measurement drops encoding Compression codecs, adaptive encoding, and compression ratio comparison compute_engine SIMD-accelerated computation, hardware tier detection, and buffer pool
Example Description field_encryption Per-column AES-256-GCM: declaring a column and its key variable, the ciphertext on disk, and the paths that refuse to write it out encryption The standalone EncryptionService: key providers, round trip, and key rotation authz Cedar authorization: namespace and system decisions, a schema that refuses a misspelt action, and least-privilege administrative capabilities audit_logging Structured audit logging with multi-sink support and queryable audit trail tenant_isolation Namespace management, quota enforcement, and resource usage tracking
Example Description model_lifecycle Model registry, A/B testing, drift detection, and accuracy tracking
Example Description quickstart The program from the Getting Started page — open, write, query, close quantile_forecast Prediction intervals from empirical residual quantiles, with conformal correction cold_tier Tiering segments to object storage as Hive-partitioned Parquet, and querying them with SQL (needs --features object-store)
Improve this page on GitHub