DataStreams-RS
DataStreams-RS maintain sliding data stream with fixed BUCKET_SIZE_MS for fixed HISTORY_SIZE. Data structure initialize with INITIAL_TS.
Measurements older {max_ts} - BUCKET_SIZE_MS * HISTORY_SIZE
will be skipped. Measurements newer {max_ts}
(initially =INITIAL_TS
) will move data frame to future and remove old data.
Data structure maintain single value for each bucket. New values for same bucket will override previous one.
Supported operations:
- Initialization
- Insert new value
- Iteration
- Boundary fetch
- Aggregation with custom
AGGREGATION_MS
(expect thatAGGREGATION_MS >> BUCKET_SIZE_MS
)- aggregation_min
- aggregation_max
- aggregation_avg
custom Fn(&Vec<f64>) -> f64
Installation
cargo install datastreams-rs
Usage
const HISTORY_SIZE: usize = 10;
const BUCKET_SIZE_MS: u64 = 1_000;
const INITIAL_TS: u64 = 1_714_321_497_981;
Release notes
0.3.0
- Remove generics data streams configuration
0.2.0
- Add aggregations
0.1.0
- Initial release
For developers
Evaluate this commands before commit:
cargo fmt
cargo clippy --all-targets --all-features -- -D warnings
Author
Mark Andreev ( linkedin.com/in/mrk-andreev; mrkandreev.name )