@@ -4,7 +4,6 @@ use std::ops::DerefMut;
44use std:: time:: Instant ;
55
66use crate :: database_logger:: { BacktraceFrame , BacktraceProvider , ModuleBacktrace , Record } ;
7- use crate :: db:: db_metrics:: DB_METRICS ;
87use crate :: execution_context:: ExecutionContext ;
98use crate :: host:: scheduler:: { ScheduleError , ScheduledReducerId } ;
109use crate :: host:: timestamp:: Timestamp ;
@@ -158,18 +157,6 @@ impl WasmInstanceEnv {
158157 self . instance_env ( ) . get_ctx ( ) . map_err ( |err| WasmError :: Db ( err. into ( ) ) )
159158 }
160159
161- // TODO: make this part of cvt(), maybe?
162- /// Gather the appropriate metadata and log a wasm_abi_call_duration_ns with the given AbiCall & duration
163- #[ allow( unused) ]
164- fn start_abi_call_timer ( & self , call : AbiCall ) -> prometheus:: HistogramTimer {
165- let db = self . instance_env ( ) . dbic . address ;
166-
167- DB_METRICS
168- . wasm_abi_call_duration_sec
169- . with_label_values ( & db, & self . reducer_name , & call)
170- . start_timer ( )
171- }
172-
173160 /// Call the function `f` with the name `func`.
174161 /// The function `f` is provided with the callers environment and the host's memory.
175162 ///
@@ -380,10 +367,6 @@ impl WasmInstanceEnv {
380367 /// according to the `ProductType` that the table's schema specifies.
381368 #[ tracing:: instrument( skip_all) ]
382369 pub fn insert ( caller : Caller < ' _ , Self > , table_id : u32 , row : WasmPtr < u8 > , row_len : u32 ) -> RtResult < u32 > {
383- // TODO: Instead of writing this metric on every insert call,
384- // we should aggregate and write at the end of the transaction.
385- // let _guard = caller.data().start_abi_call_timer(AbiCall::Insert);
386-
387370 Self :: cvt ( caller, AbiCall :: Insert , |caller| {
388371 let ( mem, env) = Self :: mem_env ( caller) ;
389372
@@ -425,10 +408,6 @@ impl WasmInstanceEnv {
425408 value_len : u32 ,
426409 out : WasmPtr < u32 > ,
427410 ) -> RtResult < u32 > {
428- // TODO: Instead of writing this metric on every insert call,
429- // we should aggregate and write at the end of the transaction.
430- // let _guard = caller.data().start_abi_call_timer(AbiCall::DeleteByColEq);
431-
432411 Self :: cvt_ret ( caller, AbiCall :: DeleteByColEq , out, |caller| {
433412 let ( mem, env) = Self :: mem_env ( caller) ;
434413 let ctx = env. reducer_context ( ) ?;
@@ -565,10 +544,6 @@ impl WasmInstanceEnv {
565544 val_len : u32 ,
566545 out : WasmPtr < BufferIdx > ,
567546 ) -> RtResult < u32 > {
568- // TODO: Instead of writing this metric on every insert call,
569- // we should aggregate and write at the end of the transaction.
570- // let _guard = caller.data().start_abi_call_timer(AbiCall::IterByColEq);
571-
572547 Self :: cvt_ret ( caller, AbiCall :: IterByColEq , out, |caller| {
573548 let ( mem, env) = Self :: mem_env ( caller) ;
574549 // Read the test value from WASM memory.
@@ -599,10 +574,6 @@ impl WasmInstanceEnv {
599574 /// - a table with the provided `table_id` doesn't exist
600575 // #[tracing::instrument(skip_all)]
601576 pub fn iter_start ( caller : Caller < ' _ , Self > , table_id : u32 , out : WasmPtr < BufferIterIdx > ) -> RtResult < u32 > {
602- // TODO: Instead of writing this metric on every insert call,
603- // we should aggregate and write at the end of the transaction.
604- // let _guard = caller.data().start_abi_call_timer(AbiCall::IterStart);
605-
606577 Self :: cvt_ret ( caller, AbiCall :: IterStart , out, |caller| {
607578 let env = caller. data_mut ( ) ;
608579 // Retrieve the execution context for the current reducer.
@@ -636,10 +607,6 @@ impl WasmInstanceEnv {
636607 filter_len : u32 ,
637608 out : WasmPtr < BufferIterIdx > ,
638609 ) -> RtResult < u32 > {
639- // TODO: Instead of writing this metric on every insert call,
640- // we should aggregate and write at the end of the transaction.
641- // let _guard = caller.data().start_abi_call_timer(AbiCall::IterStartFiltered);
642-
643610 Self :: cvt_ret ( caller, AbiCall :: IterStartFiltered , out, |caller| {
644611 let ( mem, env) = Self :: mem_env ( caller) ;
645612 // Retrieve the execution context for the current reducer.
0 commit comments