@@ -11,18 +11,16 @@ use taurus_provider::providers::emitter::nats_emitter::NATSRespondEmitter;
1111use taurus_provider:: providers:: remote:: nats_remote_runtime:: NATSRemoteRuntime ;
1212use tokio:: task:: JoinHandle ;
1313use tucana:: shared:: execution_result;
14- use tucana:: shared:: { ExecutionFlow , ExecutionResult , NodeExecutionResult , RuntimeUsage , Value } ;
14+ use tucana:: shared:: { ExecutionFlow , ExecutionResult , NodeExecutionResult , Value } ;
1515
1616use crate :: client:: runtime_execution:: TaurusRuntimeExecutionService ;
17- use crate :: client:: runtime_usage:: TaurusRuntimeUsageService ;
1817
1918pub fn spawn_worker (
2019 client : async_nats:: Client ,
2120 engine : ExecutionEngine ,
2221 nats_remote : NATSRemoteRuntime ,
2322 runtime_emitter : NATSRespondEmitter ,
2423 mut runtime_execution_service : Option < TaurusRuntimeExecutionService > ,
25- runtime_usage_service : Option < TaurusRuntimeUsageService > ,
2624) -> JoinHandle < ( ) > {
2725 tokio:: spawn ( async move {
2826 let mut execution_subscription = match client
@@ -52,7 +50,6 @@ pub fn spawn_worker(
5250 & nats_remote,
5351 & runtime_emitter,
5452 runtime_execution_service. as_mut( ) ,
55- runtime_usage_service. as_ref( ) ,
5653 ) . await ;
5754 }
5855 None => {
@@ -74,7 +71,6 @@ async fn process_execution_message(
7471 nats_remote : & NATSRemoteRuntime ,
7572 runtime_emitter : & NATSRespondEmitter ,
7673 mut runtime_execution_service : Option < & mut TaurusRuntimeExecutionService > ,
77- runtime_usage_service : Option < & TaurusRuntimeUsageService > ,
7874) {
7975 let requested_execution_id = parse_execution_id_from_subject ( & message. subject , "execution" )
8076 . unwrap_or_else ( || {
@@ -138,12 +134,6 @@ async fn process_execution_message(
138134 . update_runtime_execution ( execution_result)
139135 . await ;
140136 }
141-
142- if let Some ( usage_service) = runtime_usage_service {
143- usage_service
144- . update_runtime_usage ( run_result. runtime_usage )
145- . await ;
146- }
147137}
148138
149139#[ derive( Clone ) ]
@@ -155,7 +145,6 @@ struct FlowRunResult {
155145 input : Option < Value > ,
156146 signal : Signal ,
157147 node_execution_results : Vec < NodeExecutionResult > ,
158- runtime_usage : RuntimeUsage ,
159148}
160149
161150async fn execute_flow (
@@ -166,7 +155,6 @@ async fn execute_flow(
166155 respond_emitter : Option < & dyn RespondEmitter > ,
167156) -> FlowRunResult {
168157 let started_at = now_unix_micros ( ) ;
169- let start = Instant :: now ( ) ;
170158 let flow_id = flow. flow_id ;
171159 let input = flow. input_value . clone ( ) ;
172160 let report = engine
@@ -179,7 +167,6 @@ async fn execute_flow(
179167 )
180168 . await ;
181169 let finished_at = now_unix_micros ( ) ;
182- let duration_micros = start. elapsed ( ) . as_micros ( ) as i64 ;
183170
184171 FlowRunResult {
185172 execution_id,
@@ -189,11 +176,7 @@ async fn execute_flow(
189176 input,
190177 signal : report. signal ,
191178 node_execution_results : report. node_execution_results ,
192- runtime_usage : RuntimeUsage {
193- flow_id,
194- duration : duration_micros,
195- } ,
196- }
179+ }
197180}
198181
199182fn parse_execution_id_from_subject (
@@ -347,17 +330,15 @@ mod tests {
347330 let run_result = execute_flow ( execution_id, flow, & engine, None , None ) . await ;
348331
349332 println ! (
350- "started_at={} finished_at={} delta={} runtime_usage.duration={} " ,
333+ "started_at={} finished_at={} delta={}" ,
351334 run_result. started_at,
352335 run_result. finished_at,
353336 run_result. finished_at - run_result. started_at,
354- run_result. runtime_usage. duration
355337 ) ;
356338
357339 assert_eq ! ( run_result. execution_id, execution_id) ;
358340 assert ! ( run_result. started_at >= 1_000_000_000_000_000 ) ;
359341 assert ! ( run_result. finished_at >= run_result. started_at) ;
360- assert ! ( run_result. runtime_usage. duration > 0 ) ;
361342 assert ! (
362343 run_result
363344 . node_execution_results
0 commit comments