@@ -27,7 +27,6 @@ use ic_metrics::buckets::{decimal_buckets_with_zero, exponential_buckets};
2727use ic_replicated_state:: canister_state:: execution_state:: {
2828 SandboxMemory , SandboxMemoryHandle , SandboxMemoryOwner , WasmBinary , WasmExecutionMode ,
2929} ;
30- use ic_replicated_state:: metrics:: instructions_buckets;
3130use ic_replicated_state:: {
3231 EmbedderCache , ExecutionState , ExportedFunctions , Memory , PageMap , ReplicatedState ,
3332 page_map:: allocated_pages_count,
@@ -157,7 +156,6 @@ struct SandboxedExecutionMetrics {
157156 mprotect_count : HistogramVec ,
158157 copy_page_count : HistogramVec ,
159158 sigsegv_handler_duration : HistogramVec ,
160- dmt_projected_message_cost : HistogramVec ,
161159}
162160
163161impl SandboxedExecutionMetrics {
@@ -411,12 +409,6 @@ impl SandboxedExecutionMetrics {
411409 decimal_buckets_with_zero ( -4 , 1 ) ,
412410 & [ "api_type" , "memory_type" ] ,
413411 ) ,
414- dmt_projected_message_cost : metrics_registry. histogram_vec (
415- "sandboxed_execution_dmt_projected_message_cost" ,
416- "Cost of a message when the DMT charges for all page accesses." ,
417- instructions_buckets ( ) , /* same as scheduler_instructions_consumed_per_message for comparison */
418- & [ "api_type" , "memory_type" ] ,
419- ) ,
420412 }
421413 }
422414
@@ -502,10 +494,6 @@ impl SandboxedExecutionMetrics {
502494 . with_label_values ( & [ api_type_label, "stable" ] )
503495 . observe ( instance_stats. stable_sigsegv_handler_duration . as_secs_f64 ( ) ) ;
504496
505- self . dmt_projected_message_cost
506- . with_label_values ( & [ api_type_label, "both" ] )
507- . observe ( instance_stats. dmt_projected_message_cost as f64 ) ;
508-
509497 self . allocated_pages . set ( allocated_pages_count ( ) as i64 ) ;
510498 }
511499}
@@ -1709,7 +1697,7 @@ impl SandboxedExecutionController {
17091697 } ) ;
17101698 return WasmExecutionResult :: Paused ( slice, paused) ;
17111699 }
1712- CompletionResult :: Finished ( mut exec_output) => {
1700+ CompletionResult :: Finished ( exec_output) => {
17131701 let execution_status = match exec_output. wasm . wasm_result . clone ( ) {
17141702 Ok ( Some ( WasmResult :: Reply ( _) ) ) => "Success" ,
17151703 Ok ( Some ( WasmResult :: Reject ( _) ) ) => "Reject" ,
@@ -1721,19 +1709,6 @@ impl SandboxedExecutionController {
17211709 execution_status,
17221710 execution_state. wasm_execution_mode . as_str ( ) ,
17231711 ) ;
1724- // Temporary metric: How much will the message cost when we charge via DMT.
1725- let instructions_used = message_instruction_limit
1726- . saturating_sub ( & exec_output. wasm . num_instructions_left ) ;
1727- let stable_writes = exec_output. wasm . instance_stats . stable_dirty_pages ;
1728- let stable_reads = exec_output. wasm . instance_stats . stable_accessed_pages ;
1729- let heap_writes = exec_output. wasm . instance_stats . wasm_dirty_pages ;
1730- let heap_reads = exec_output. wasm . instance_stats . wasm_accessed_pages - heap_writes;
1731- // we currently charge 1000 for stable and heap writes (plus 3000 for copy overhead, which remains separate), and 0 for everything else.
1732- let additional_cost =
1733- ( stable_writes + heap_writes) * 4000 + ( stable_reads + heap_reads) * 5000 ;
1734- exec_output. wasm . instance_stats . dmt_projected_message_cost =
1735- instructions_used. get ( ) as usize + additional_cost;
1736-
17371712 self . metrics
17381713 . observe_instance_stats ( & exec_output. wasm . instance_stats , api_type_label) ;
17391714 exec_output
0 commit comments