WIP on second AggKind
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use crate::agg::binnedt::{AggregatableTdim, AggregatorTdim};
|
||||
use crate::agg::streams::{Batchable, Bins};
|
||||
use crate::agg::{AggregatableXdim1Bin, Fits, FitsInside};
|
||||
use crate::binned::MakeBytesFrame;
|
||||
use crate::frame::makeframe::make_frame;
|
||||
@@ -233,6 +234,23 @@ impl AggregatableTdim for MinMaxAvgScalarBinBatch {
|
||||
}
|
||||
}
|
||||
|
||||
impl Batchable for MinMaxAvgScalarBinBatch {
|
||||
fn append(&mut self, k: &mut Self) {
|
||||
self.ts1s.append(&mut k.ts1s);
|
||||
self.ts2s.append(&mut k.ts2s);
|
||||
self.counts.append(&mut k.counts);
|
||||
self.mins.append(&mut k.mins);
|
||||
self.maxs.append(&mut k.maxs);
|
||||
self.avgs.append(&mut k.avgs);
|
||||
}
|
||||
}
|
||||
|
||||
impl Bins for MinMaxAvgScalarBinBatch {
|
||||
fn bin_count(&self) -> u32 {
|
||||
self.ts1s.len() as u32
|
||||
}
|
||||
}
|
||||
|
||||
pub struct MinMaxAvgScalarBinBatchAggregator {
|
||||
ts1: u64,
|
||||
ts2: u64,
|
||||
|
||||
23
disk/src/agg/streams.rs
Normal file
23
disk/src/agg/streams.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use crate::streamlog::LogItem;
|
||||
use netpod::EventDataReadStats;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub enum StatsItem {
|
||||
EventDataReadStats(EventDataReadStats),
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub enum StreamItem<T> {
|
||||
DataItem(T),
|
||||
Log(LogItem),
|
||||
Stats(StatsItem),
|
||||
}
|
||||
|
||||
pub trait Bins {
|
||||
fn bin_count(&self) -> u32;
|
||||
}
|
||||
|
||||
pub trait Batchable {
|
||||
fn append(&mut self, k: &mut Self);
|
||||
}
|
||||
Reference in New Issue
Block a user