pub struct CodedTimeSeriesWriter<'a> { /* 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<'a> CodedTimeSeriesWriter<'a>
impl<'a> CodedTimeSeriesWriter<'a>
pub fn new<T: AsRef<Path>>(path: T) -> Result<Self, Error>
pub fn float_stream(self) -> CodedTimeSeriesFloatWriter<'a>
pub fn int_stream(self) -> CodedTimeSeriesIntWriter<'a>
pub fn write_str( &mut self, time: Time64, value: StrWrapper<'a>, ) -> Result<(), Error>
pub fn flush(&mut self) -> Result<(), Error>
pub fn written_stats(&self) -> Vec<String>
pub fn metadata( &'a mut self, key: Arc<String>, value: Arc<String>, ) -> Result<(), Error>
Auto Trait Implementations§
impl<'a> Freeze for CodedTimeSeriesWriter<'a>
impl<'a> !RefUnwindSafe for CodedTimeSeriesWriter<'a>
impl<'a> !Send for CodedTimeSeriesWriter<'a>
impl<'a> !Sync for CodedTimeSeriesWriter<'a>
impl<'a> Unpin for CodedTimeSeriesWriter<'a>
impl<'a> !UnwindSafe for CodedTimeSeriesWriter<'a>
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