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
46 changes: 46 additions & 0 deletions crates/cost/src/node/cost_terms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ pub enum CostConstant {
ExactDistinctOperationsPerInsertedValue,
ExactDistinctOperationsPerInsertedPair,
SketchUpdateOperationsPerCounter,
CounterMatrixUpdateOperationsPerCounter,
UnivmonUpdateOperationsPerCounter,
CmsHeapOperationsPerEstimate,
CmsHeapOperationsPerEstimatedCounter,
CountSketchHeapOperationsPerEstimate,
CountSketchHeapOperationsPerEstimatedCounter,
SketchAllocationOperationsPerCounter,
ExactMergeOperationsPerState,
ExtremumMergeOperationsPerState,
CounterMergeOperationsPerState,
Expand All @@ -63,9 +70,14 @@ pub enum CostConstant {
KllMergeOperationsPerMergedByte,
MergeOperationsPerOutputGroup,
SketchMergeOperationsPerByte,
CounterMatrixMergeOperationsPerState,
CounterMatrixMergeOperationsPerCounter,
HeapMergeOperationsPerResidentCounter,
KllEstimateOperationsPerByte,
KllEstimateOperationsPerUnsortedItem,
SketchEstimateOperationsPerGroup,
HeapReadOperationsPerGroup,
HeapReadOperationsPerResidentCounter,
OutputRowOperationsPerGroup,
SketchChainEmitOperationsPerState,
ExactChainEmitOperationsPerState,
Expand Down Expand Up @@ -180,6 +192,40 @@ impl CostConstant {
CostConstant::KllMergeOperationsPerOutputGroup => {
built_in::KLL_MERGE_OPERATIONS_PER_OUTPUT_GROUP
}
CostConstant::CounterMatrixUpdateOperationsPerCounter => {
built_in::COUNTER_MATRIX_UPDATE_OPERATIONS_PER_COUNTER
}
CostConstant::UnivmonUpdateOperationsPerCounter => {
built_in::UNIVMON_UPDATE_OPERATIONS_PER_COUNTER
}
CostConstant::CmsHeapOperationsPerEstimate => {
built_in::CMS_HEAP_OPERATIONS_PER_ESTIMATE
}
CostConstant::CmsHeapOperationsPerEstimatedCounter => {
built_in::CMS_HEAP_OPERATIONS_PER_ESTIMATED_COUNTER
}
CostConstant::CountSketchHeapOperationsPerEstimate => {
built_in::COUNT_SKETCH_HEAP_OPERATIONS_PER_ESTIMATE
}
CostConstant::CountSketchHeapOperationsPerEstimatedCounter => {
built_in::COUNT_SKETCH_HEAP_OPERATIONS_PER_ESTIMATED_COUNTER
}
CostConstant::SketchAllocationOperationsPerCounter => {
built_in::SKETCH_ALLOCATION_OPERATIONS_PER_COUNTER
}
CostConstant::CounterMatrixMergeOperationsPerState => {
built_in::COUNTER_MATRIX_MERGE_OPERATIONS_PER_STATE
}
CostConstant::CounterMatrixMergeOperationsPerCounter => {
built_in::COUNTER_MATRIX_MERGE_OPERATIONS_PER_COUNTER
}
CostConstant::HeapMergeOperationsPerResidentCounter => {
built_in::HEAP_MERGE_OPERATIONS_PER_RESIDENT_COUNTER
}
CostConstant::HeapReadOperationsPerGroup => built_in::HEAP_READ_OPERATIONS_PER_GROUP,
CostConstant::HeapReadOperationsPerResidentCounter => {
built_in::HEAP_READ_OPERATIONS_PER_RESIDENT_COUNTER
}
}
}
}
Expand Down
16 changes: 14 additions & 2 deletions crates/cost/src/node/cost_terms/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn every_per_unit_constant_has_a_cost_constant() {
.iter()
.map(|constant| format!("{constant:?}"))
.collect();
assert_eq!(defined.len(), 39, "{defined:?}");
assert_eq!(defined.len(), 51, "{defined:?}");
assert_eq!(
defined.difference(&variants).collect::<Vec<_>>(),
Vec::<&String>::new(),
Expand Down Expand Up @@ -103,7 +103,7 @@ fn cost_constant_json_names_are_the_full_snake_case_list() {
}

/// Every constant's JSON name, in declaration order.
const JSON_NAMES: [&str; 39] = [
const JSON_NAMES: [&str; 51] = [
"time_range_operations_per_row",
"operations_per_group_per_raw_batch",
"chain_operations_per_arriving_row",
Expand All @@ -127,6 +127,13 @@ const JSON_NAMES: [&str; 39] = [
"exact_distinct_operations_per_inserted_value",
"exact_distinct_operations_per_inserted_pair",
"sketch_update_operations_per_counter",
"counter_matrix_update_operations_per_counter",
"univmon_update_operations_per_counter",
"cms_heap_operations_per_estimate",
"cms_heap_operations_per_estimated_counter",
"count_sketch_heap_operations_per_estimate",
"count_sketch_heap_operations_per_estimated_counter",
"sketch_allocation_operations_per_counter",
"exact_merge_operations_per_state",
"extremum_merge_operations_per_state",
"counter_merge_operations_per_state",
Expand All @@ -136,9 +143,14 @@ const JSON_NAMES: [&str; 39] = [
"kll_merge_operations_per_merged_byte",
"merge_operations_per_output_group",
"sketch_merge_operations_per_byte",
"counter_matrix_merge_operations_per_state",
"counter_matrix_merge_operations_per_counter",
"heap_merge_operations_per_resident_counter",
"kll_estimate_operations_per_byte",
"kll_estimate_operations_per_unsorted_item",
"sketch_estimate_operations_per_group",
"heap_read_operations_per_group",
"heap_read_operations_per_resident_counter",
"output_row_operations_per_group",
"sketch_chain_emit_operations_per_state",
"exact_chain_emit_operations_per_state",
Expand Down
Loading
Loading