pub struct CodedTimeSeriesWriter { /* private fields */ }
Available on crate features
std
and miniz
only.Expand description
Coded Time Series Sample File consists of 2 streams: a data stream and a time stream backed by a MultiStreamWriter
Data stream:
- Convert
f64
tou64
bit-for-bit - Run it through a
irox_tools::codec::CodeDictionary
to map the observed values into uniqueu32
codes - Group those codes into blocks of 4 using
GroupCodingStream
and then encode into Varint-GB usingGroupVarintCodeEncoder
- Deflate/GZ the resultant byte stream.
It is assumed that the data stream samples come from something approximating a A2D sensor with a fixed number of detection bits and as such, most of the data will be fairly similar, even if very noisy when it jumps around.
Time stream:
0. Convert the time value into a u64
(external)
- Run it through a
DeltaStream
to encode the first value, and then output theN-1
difference - Run it through the same 2, 3, 4 processing as the data stream.
It is assumed that the time series will be periodically sampled and atomically increasing
Implementations§
Source§impl CodedTimeSeriesWriter
impl CodedTimeSeriesWriter
pub fn new<T: AsRef<Path>>(path: T) -> Result<Self, Error>
pub fn write_sample(&mut self, sample: &Sample64) -> Result<(), Error>
pub fn flush(&mut self) -> Result<(), Error>
pub fn written_stats(&self) -> Vec<String>
pub fn metadata<K: AsRef<str>, V: AsRef<str>>( &mut self, key: K, value: V, ) -> Result<(), Error>
Auto Trait Implementations§
impl Freeze for CodedTimeSeriesWriter
impl !RefUnwindSafe for CodedTimeSeriesWriter
impl !Send for CodedTimeSeriesWriter
impl !Sync for CodedTimeSeriesWriter
impl Unpin for CodedTimeSeriesWriter
impl !UnwindSafe for CodedTimeSeriesWriter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more