Refactoring

This commit is contained in:
Dominik Werder
2022-06-15 14:27:38 +02:00
parent 7063842c4c
commit 9e3395bf13
25 changed files with 429 additions and 421 deletions

View File

@@ -1711,6 +1711,12 @@ impl DiskIoTune {
}
}
impl Default for DiskIoTune {
fn default() -> Self {
Self::default()
}
}
pub fn channel_from_pairs(pairs: &BTreeMap<String, String>) -> Result<Channel, Error> {
let ret = Channel {
backend: pairs

View File

@@ -71,8 +71,28 @@ pub struct RawEventsQuery {
pub channel: Channel,
pub range: NanoRange,
pub agg_kind: AggKind,
#[serde(default)]
pub disk_io_tune: DiskIoTune,
#[serde(default)]
pub do_decompress: bool,
#[serde(default)]
pub do_test_main_error: bool,
#[serde(default)]
pub do_test_stream_error: bool,
}
impl RawEventsQuery {
pub fn new(channel: Channel, range: NanoRange, agg_kind: AggKind) -> Self {
Self {
channel,
range,
agg_kind,
disk_io_tune: DiskIoTune::default(),
do_decompress: false,
do_test_main_error: false,
do_test_stream_error: false,
}
}
}
#[derive(Clone, Debug)]