From 808433b21887d3292b5d151f87fe3d2a9d577dd1 Mon Sep 17 00:00:00 2001 From: KC Sivaramakrishnan Date: Fri, 19 Jul 2024 09:59:48 +0530 Subject: [PATCH] Emit counter events --- lib/olly_trace/olly_trace.ml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/olly_trace/olly_trace.ml b/lib/olly_trace/olly_trace.ml index 5ad851c..027b37a 100644 --- a/lib/olly_trace/olly_trace.ml +++ b/lib/olly_trace/olly_trace.ml @@ -12,6 +12,15 @@ let trace fmt trace_filename exec_args = kind; } in + let runtime_counter ring_id ts counter value = + Format.emit tracer + { + name = Runtime_events.runtime_counter_name counter; + ts = Runtime_events.Timestamp.to_int64 ts; + ring_id; + kind = Counter value; + } + in let runtime_begin = runtime_phase SpanBegin and runtime_end = runtime_phase SpanEnd and init () = () @@ -21,9 +30,9 @@ let trace fmt trace_filename exec_args = let open Olly_common.Launch in olly { - empty_config with extra; runtime_begin; + runtime_counter; runtime_end; lifecycle; init;