7#include "roo_io/data/output_stream_writer.h"
24 struct SampleAggregator {
26 : weighted_total(0), weight(0), min_value(0xFFFF), max_value(0) {}
28 uint32_t weighted_total;
34 std::vector<SampleAggregator> data_;
35 std::map<uint64_t, int> index_;
53 void close() { writer_.close(); }
68 bool ok()
const {
return writer_.ok(); }
71 roo_io::Status
status()
const {
return writer_.status(); }
79 roo_io::OutputStreamWriter writer_;
Aggregates samples for a vault file time bucket.
void clear()
Clears any accumulated data.
void add(const Sample &sample)
Adds a sample into the aggregation state.
Collection of timeseries sharing transform and source resolution.
Represents a single data sample stored in a vault file.
Identifies a specific file in the monitoring vault.
Writes vault files for a collection at a specific resolution.
int write_index() const
Returns the current write index within the vault file.
roo_io::Status openExisting(int write_index)
Opens an existing vault file, seeking to the specified entry index.
void writeAggregatedData(const Aggregator &aggregator)
Writes aggregated samples into the vault file.
roo_io::Status status() const
Returns the current writer status.
const VaultFileRef & vault_ref() const
Returns the reference to the vault file being written.
void writeEmptyData()
Writes an empty vault file payload.
void close()
Closes the underlying writer.
roo_io::Status openNew()
Opens a new vault file for writing.
void writeLogData(const std::vector< LogSample > &data)
Writes raw log samples into the vault file.
bool ok() const
Returns true if the writer is in a good state.
Umbrella header for the roo_monitoring module.