More generic BinnedBytesForHttpStream, changes for status page

This commit is contained in:
Dominik Werder
2021-05-18 16:35:51 +02:00
parent 530f88cd44
commit 19ff08a4bd
10 changed files with 289 additions and 38 deletions

View File

@@ -5,6 +5,7 @@ use futures_util::StreamExt;
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
use std::pin::Pin;
use std::str::FromStr;
use std::task::{Context, Poll};
use timeunits::*;
#[allow(unused_imports)]
@@ -595,6 +596,18 @@ pub enum AggKind {
DimXBins1,
}
impl FromStr for AggKind {
type Err = Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
if s == "DimXBins1" {
Ok(AggKind::DimXBins1)
} else {
Err(Error::with_msg(format!("can not parse {} as AggKind", s)))
}
}
}
pub fn query_params(q: Option<&str>) -> std::collections::BTreeMap<String, String> {
let mut map = std::collections::BTreeMap::new();
match q {