Show query range in CLI, improve cache read

This commit is contained in:
Dominik Werder
2021-05-27 15:02:59 +02:00
parent 7aecf59195
commit e55751ad67
2 changed files with 27 additions and 9 deletions

View File

@@ -47,6 +47,10 @@ pub async fn get_binned(
disk_stats_every_kb: u32,
) -> Result<(), Error> {
info!("------- get_binned client");
info!("channel {}", channel_name);
info!("beg {}", beg_date);
info!("end {}", end_date);
info!("-------");
let t1 = Utc::now();
let date_fmt = "%Y-%m-%dT%H:%M:%S.%3fZ";
let uri = format!(
@@ -65,7 +69,6 @@ pub async fn get_binned(
cache_usage.query_param_value(),
disk_stats_every_kb,
);
info!("get_binned uri {:?}", uri);
let req = hyper::Request::builder()
.method(http::Method::GET)
.uri(uri)
@@ -78,7 +81,15 @@ pub async fn get_binned(
let (head, body) = res.into_parts();
let buf = hyper::body::to_bytes(body).await?;
let s = String::from_utf8_lossy(&buf);
return Err(Error::with_msg(format!("Server error {:?}\n---------------------- message from http body:\n{}\n---------------------- end of http body", head, s)));
return Err(Error::with_msg(format!(
concat!(
"Server error {:?}\n",
"---------------------- message from http body:\n",
"{}\n",
"---------------------- end of http body",
),
head, s
)));
}
let perf_opts = PerfOpts { inmem_bufcap: 512 };
let s1 = disk::cache::HttpBodyAsAsyncRead::new(res);