mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-23 08:58:11 -07:00
global: reorg fixes + clients improved
This commit is contained in:
@@ -156,6 +156,7 @@ impl Query {
|
||||
Ok(ResolvedQuery {
|
||||
vecs,
|
||||
format: params.format(),
|
||||
index: params.index,
|
||||
version,
|
||||
total,
|
||||
start,
|
||||
@@ -170,6 +171,7 @@ impl Query {
|
||||
let ResolvedQuery {
|
||||
vecs,
|
||||
format,
|
||||
index,
|
||||
version,
|
||||
total,
|
||||
start,
|
||||
@@ -182,7 +184,7 @@ impl Query {
|
||||
Format::JSON => {
|
||||
if vecs.len() == 1 {
|
||||
let mut buf = Vec::new();
|
||||
MetricData::serialize(vecs[0], start, end, &mut buf)?;
|
||||
MetricData::serialize(vecs[0], index, start, end, &mut buf)?;
|
||||
Output::Json(buf)
|
||||
} else {
|
||||
let mut buf = Vec::new();
|
||||
@@ -191,7 +193,7 @@ impl Query {
|
||||
if i > 0 {
|
||||
buf.push(b',');
|
||||
}
|
||||
MetricData::serialize(*vec, start, end, &mut buf)?;
|
||||
MetricData::serialize(*vec, index, start, end, &mut buf)?;
|
||||
}
|
||||
buf.push(b']');
|
||||
Output::Json(buf)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use brk_types::{Etag, Format};
|
||||
use brk_types::{Etag, Format, Index};
|
||||
use vecdb::AnyExportableVec;
|
||||
|
||||
/// A resolved metric query ready for formatting.
|
||||
@@ -6,6 +6,7 @@ use vecdb::AnyExportableVec;
|
||||
pub struct ResolvedQuery {
|
||||
pub(crate) vecs: Vec<&'static dyn AnyExportableVec>,
|
||||
pub(crate) format: Format,
|
||||
pub(crate) index: Index,
|
||||
pub(crate) version: u64,
|
||||
pub(crate) total: usize,
|
||||
pub(crate) start: usize,
|
||||
|
||||
Reference in New Issue
Block a user