mirror of
https://github.com/ocaml-tracing/ocaml-trace.git
synced 2026-03-07 18:37:56 -05:00
update test with counters
This commit is contained in:
parent
341f137ebd
commit
3db8f73dcb
2 changed files with 655 additions and 450 deletions
1098
test/t1.expected
1098
test/t1.expected
File diff suppressed because it is too large
Load diff
|
|
@ -1,11 +1,16 @@
|
||||||
let run () =
|
let run () =
|
||||||
Trace.set_process_name "main";
|
Trace.set_process_name "main";
|
||||||
Trace.set_thread_name "t1";
|
Trace.set_thread_name "t1";
|
||||||
|
|
||||||
|
let n = ref 0 in
|
||||||
|
|
||||||
for _i = 1 to 50 do
|
for _i = 1 to 50 do
|
||||||
Trace.with_span ~__FILE__ ~__LINE__ "outer.loop" @@ fun _sp ->
|
Trace.with_span ~__FILE__ ~__LINE__ "outer.loop" @@ fun _sp ->
|
||||||
for _j = 2 to 5 do
|
for _j = 2 to 5 do
|
||||||
|
incr n;
|
||||||
Trace.with_span ~__FILE__ ~__LINE__ "inner.loop" @@ fun _sp ->
|
Trace.with_span ~__FILE__ ~__LINE__ "inner.loop" @@ fun _sp ->
|
||||||
Trace.messagef (fun k -> k "hello %d %d" _i _j)
|
Trace.messagef (fun k -> k "hello %d %d" _i _j);
|
||||||
|
Trace.counter_int "n" !n
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue