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
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
python3 -m unittest -v test_viewer test_server

- name: Run the DAG viewer's Node tests
run: node --test tools/dag-viewer/stages.test.mjs tools/dag-viewer/enumeration.test.mjs tools/dag-viewer/memo.test.mjs
run: node --test tools/dag-viewer/stages.test.mjs tools/dag-viewer/memo.test.mjs

- name: Verify MetricsQL frontend as a stable external dependency
run: bash tools/verify_metricsql_external_consumer.sh
Expand Down
7 changes: 2 additions & 5 deletions crates/cost/src/node/state_bytes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,6 @@ const DDSKETCH_ASSUMED_MAGNITUDE_RANGE: ValueMagnitudeRange = ValueMagnitudeRang
max_abs: 1e9,
};

/// The Euler–Mascheroni constant γ.
const EULER_GAMMA: f64 = 0.577_215_664_901_532_9;

/// The ratio of the largest to the smallest of `rows` values a DDSketch
/// state is assumed to span when the workload declares nothing about its
/// values: `rows` samples of an exponential distribution, as latencies
Expand All @@ -371,8 +368,8 @@ const EULER_GAMMA: f64 = 0.577_215_664_901_532_9;
/// exponential (Pareto) are under-charged.
fn exponential_values_magnitude_ratio(rows: u64) -> f64 {
let n = rows.max(1) as f64;
let harmonic = n.ln() + EULER_GAMMA + 1.0 / (2.0 * n);
n * harmonic * EULER_GAMMA.exp()
let harmonic = n.ln() + std::f64::consts::EULER_GAMMA + 1.0 / (2.0 * n);
n * harmonic * std::f64::consts::EULER_GAMMA.exp()
}

/// The bytes a DDSketch of relative accuracy `alpha` is expected to hold
Expand Down
4 changes: 2 additions & 2 deletions crates/types/src/plan/physical_asap_dag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use crate::ir::properties::execution_data_state::{ExecutionDataState, ExecutionT
use crate::ir::properties::selection::SelectionBox;
use crate::ir::schema::Schema;
use crate::stages::PhysicalCandidateId;
use crate::stages::{Lifetime, PhysicalPropertiesError, StorageMedium};
use crate::stages::{Lifetime, PhysicalPropertiesError};
use crate::summary_type::SketchParams;

/// A node's operator, with each child replaced by its node id.
Expand Down Expand Up @@ -750,7 +750,7 @@ pub(crate) fn physical_asap_dag_at_query_time_with_node_ids(
}
for node in &mut dag.nodes {
if consumers[node.id] > 1 {
node.lifetime = Lifetime::OneEvaluation(StorageMedium::Memory);
node.lifetime = Lifetime::OneEvaluation(crate::stages::StorageMedium::Memory);
}
}
Ok((dag, nodes_by_id))
Expand Down
1 change: 0 additions & 1 deletion tools/verify_metricsql_external_consumer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ cat > "$consumer_dir/src/main.rs" <<'EOF'
fn main() {
asap_frontend_metricsql::lower_metricsql(
"sum(rate(requests_total[5m]))",
asap_types::ir::properties::AccuracyTarget::exact(),
std::time::Duration::from_secs(15),
)
.expect("a downstream stable crate can parse and lower MetricsQL");
Expand Down
Loading