refactor: read_filter debugging

pull/24376/head
Edd Robinson 2021-06-14 10:22:05 +01:00
parent 42d5076772
commit 96fb595cc0
2 changed files with 37 additions and 1 deletions

View File

@ -11,6 +11,7 @@ pub mod stringset;
mod task;
pub use context::{DEFAULT_CATALOG, DEFAULT_SCHEMA};
use futures::{future, Future};
use observability_deps::tracing::debug;
use std::sync::Arc;
@ -190,6 +191,40 @@ impl Executor {
results.extend(handle?.into_iter());
}
// TEMP(edd): attempting to get more insight into series frame
// construction.
//
// Consider removing as very noisy
//
for (i, result) in results.iter().enumerate() {
if let SeriesSetItem::Data(item) = result {
if i == 0 {
// emit batch used across the series set.
//
// TEMP(edd): clones record batch.
//
if let Ok(rb) =
arrow::util::pretty::pretty_format_batches(&[item.batch.clone()])
{
debug!("record batch {}", rb);
}
}
let tags = item
.tags
.iter()
.map(|(k, v)| format!(" ({}, {})", k, v))
.collect::<Vec<_>>();
debug!(
table_name = item.table_name.as_ref(),
?tags,
start_row = item.start_row,
num_rows = item.num_rows,
"series set item"
);
}
}
//
Ok(results)
}

View File

@ -24,7 +24,7 @@ use generated_types::{
TimestampRange,
};
use metrics::KeyValue;
use observability_deps::tracing::{error, info};
use observability_deps::tracing::{debug, error, info};
use query::{
exec::fieldlist::FieldList, exec::seriesset::Error as SeriesSetError,
predicate::PredicateBuilder, DatabaseStore,
@ -251,6 +251,7 @@ where
.map(Ok)
.collect::<Vec<_>>();
debug!(?results, "read_filter response");
ob.ok_with_labels(labels);
Ok(tonic::Response::new(futures::stream::iter(results)))
}