Skip to main content

parse_data

Function parse_data 

Source
pub fn parse_data(body: &str) -> Result<Vec<TimeSeries>>
Expand description

Decode a getData.json body: one TimeSeries per PV, empty for [ ]. Tolerates bare NaN/Infinity/-Infinity, string or numeric PREC/LOPR/HOPR, unknown keys, and fields objects. A severity-3 sample whose fields hold cnxlostepsecs becomes a Sample::gap. A 5-element array val on a scalar PV is an optimized bin (binned = true); other arrays are waveforms (val holds element 0).

Without knowing the request, a series whose every array value has five elements with a whole, non-negative count is taken as bins; ArchiverClient::get_data only does that for optimized requests.