Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ version = "0.1.0"
asap_sketchlib = { git = "https://github.com/ProjectASAP/asap_sketchlib", branch = "main" }

[workspace.dependencies]
# Keep Planner frontends, selection, and IR on the same immutable revision.
# Keep Planner frontends, selection, and IR on the same immutable revision (current-series Planner PR).
# Alias upstream asap-types because this workspace also defines asap_types.
planner-types = { package = "asap-types", git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "ca7546de792d74aee8231e9a1100ca893d9e86d3" }
asap-aware-mapping = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "ca7546de792d74aee8231e9a1100ca893d9e86d3" }
asap-frontend-promql = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "ca7546de792d74aee8231e9a1100ca893d9e86d3" }
asap-frontend-sql = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "ca7546de792d74aee8231e9a1100ca893d9e86d3" }
planner-types = { package = "asap-types", git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "b8b5d705215200361b6a2c3b389d513d554077ca" }
asap-aware-mapping = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "b8b5d705215200361b6a2c3b389d513d554077ca" }
asap-frontend-promql = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "b8b5d705215200361b6a2c3b389d513d554077ca" }
asap-frontend-sql = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "b8b5d705215200361b6a2c3b389d513d554077ca" }

# Shared external deps (used by 2+ crates)
serde = { version = "1.0", features = ["derive"] }
Expand Down
21 changes: 15 additions & 6 deletions control_plane/src/emit/backend_wire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ pub(crate) fn build_backend_aggregation_json(agg: &BackendAggregation) -> JsonVa
match kind {
ExactKind::Sum => "Sum",
ExactKind::Count => "Count",
ExactKind::MinMax => "MinMax",
// Typed `Min` shares the MinMax accumulator on the wire; the
// readout direction is carried by the aggregation sub-type.
ExactKind::MinMax | ExactKind::Min => "MinMax",
ExactKind::Increase => "Increase",
ExactKind::Rate => "Rate",
ExactKind::IRate => "IRate",
Expand Down Expand Up @@ -284,13 +286,20 @@ pub(crate) fn build_backend_aggregation_json(agg: &BackendAggregation) -> JsonVa
clamp_window_secs(Some(agg.window_secs)).expect("clamp_window_secs preserves Some");
json!({
"aggregationType": aggregation_type,
"aggregationSubType": if matches!(
&agg.family,
// `MinMax` and the typed `Min` share one accumulator on the wire, so the
// readout direction has to travel in the sub-type or the backend cannot
// tell which end of the window the query wants.
"aggregationSubType": match &agg.family {
planner_types::post_asap::SummaryFamilyType::ExactAggregate(
planner_types::post_asap::ExactKind::MinMax,
_
)
) { "max" } else { "" },
_,
) => "max",
planner_types::post_asap::SummaryFamilyType::ExactAggregate(
planner_types::post_asap::ExactKind::Min,
_,
) => "min",
_ => "",
},
"metric": agg.metric_name,
"labels": {
"grouping": agg.grouping,
Expand Down
Loading
Loading