diff options
Diffstat (limited to 'src/crates/candelabra')
-rw-r--r-- | src/crates/candelabra/src/profiler/info.rs | 12 | ||||
-rw-r--r-- | src/crates/candelabra/src/select.rs | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/crates/candelabra/src/profiler/info.rs b/src/crates/candelabra/src/profiler/info.rs index fe66c3c..6f24ba7 100644 --- a/src/crates/candelabra/src/profiler/info.rs +++ b/src/crates/candelabra/src/profiler/info.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use std::str::FromStr; use anyhow::{anyhow, Result}; -use log::debug; +use log::{debug, trace}; use primrose::ContainerSelection; use serde::{Deserialize, Serialize}; @@ -166,15 +166,19 @@ impl ProfilerPartition { } pub fn estimate_cost(&self, cost_model: &CostModel) -> f64 { - cost_model + let val = cost_model .by_op .iter() .map(|(op, estimator)| self.op_cost(op, estimator)) - .sum::<f64>() + .sum::<f64>(); + trace!("-- partition cost: {val}"); + val } pub fn op_cost(&self, op: &str, estimator: &Estimator) -> f64 { - estimator.estimatef(self.avg_n) * self.avg_op_count(op) * self.occurences + let val = estimator.estimatef(self.avg_n) * self.avg_op_count(op) * self.occurences; + trace!("cost of {op} for partition: {val}"); + val } /// Get a breakdown of the cost by operation diff --git a/src/crates/candelabra/src/select.rs b/src/crates/candelabra/src/select.rs index 70b0f4e..815fe3a 100644 --- a/src/crates/candelabra/src/select.rs +++ b/src/crates/candelabra/src/select.rs @@ -3,6 +3,7 @@ use std::collections::HashMap; use crate::{cost::Cost, types::ConTypeTo, Project, State}; use anyhow::Result; +use log::trace; use primrose::ContainerSelection; pub type ProjectSelections = ConTypeTo<ContainerSelection>; @@ -49,6 +50,7 @@ impl State { // Get an estimate for each candidate for candidate in candidates { let model = self.cost_model(candidate)?; + trace!("estimating cost of {candidate}"); costs.push(( ContainerSelection::Singular(candidate.to_string()), profile_info.estimate_cost(&model), |