update

Function update 

Source
pub fn update<'a, D, B, I>(
    filename: &Path,
    ds_names: &[&str],
    extra_flags: ExtraFlags,
    data: I,
) -> RrdResult<()>
where D: AsRef<[Datum]> + 'a, B: Borrow<(BatchTime, D)>, I: IntoIterator<Item = B>,
Expand description

Update only the DS names specified in ds_names.

No COMPUTE DS names should be included, as those do not have values directly provided. DS names not specified (other than COMPUTE DSs) will have unknown values applied for the given timestamps.

data is a sequence of timestamps with one datum per DS at that timestamp.

Each batch of data must have the same number of data points.

This corresponds to rrdtool update with the --template parameter.

See https://oss.oetiker.ch/rrdtool/doc/rrdupdate.en.html.

ยงExamples

use std::path::Path;
use rrd::error::RrdResult;
use rrd::ops::update::{update, BatchTime, ExtraFlags};

fn add_some_data(f: &Path) -> RrdResult<()> {
    update(
        f,
        // Other DSs will have "unknown" data at the provided timestamps
        &["ds2"],
        ExtraFlags::empty(),
        // 1 data point per listed DS above at each timestamp
        &[(BatchTime::Now, &[2_f64.into()])])
}