mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 03:05:30 -05:00
fix test for FLS
use the inheritable keys
This commit is contained in:
parent
c03949dbd9
commit
0da3ce4e72
2 changed files with 6 additions and 3 deletions
3
Makefile
3
Makefile
|
|
@ -9,6 +9,9 @@ clean:
|
||||||
test:
|
test:
|
||||||
@dune runtest $(DUNE_OPTS)
|
@dune runtest $(DUNE_OPTS)
|
||||||
|
|
||||||
|
test-autopromote:
|
||||||
|
@dune runtest $(DUNE_OPTS) --auto-promote
|
||||||
|
|
||||||
doc:
|
doc:
|
||||||
@dune build $(DUNE_OPTS) @doc
|
@dune build $(DUNE_OPTS) @doc
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ module FLS = Moonpool_fib.Fls
|
||||||
|
|
||||||
type span_id = int
|
type span_id = int
|
||||||
|
|
||||||
let k_parent : span_id option FLS.t = FLS.create ()
|
let k_parent : span_id Hmap.key = Hmap.Key.create ()
|
||||||
let ( let@ ) = ( @@ )
|
let ( let@ ) = ( @@ )
|
||||||
let spf = Printf.sprintf
|
let spf = Printf.sprintf
|
||||||
|
|
||||||
|
|
@ -39,10 +39,10 @@ module Tracer = struct
|
||||||
|
|
||||||
let with_span self name f =
|
let with_span self name f =
|
||||||
let id = Span.new_id_ () in
|
let id = Span.new_id_ () in
|
||||||
let parent = FLS.get ~default:None k_parent in
|
let parent = FLS.get_in_local_hmap_opt k_parent in
|
||||||
let span = { Span.id; parent; msg = name } in
|
let span = { Span.id; parent; msg = name } in
|
||||||
add self span;
|
add self span;
|
||||||
FLS.with_value k_parent (Some id) f
|
FLS.with_in_local_hmap k_parent id f
|
||||||
end
|
end
|
||||||
|
|
||||||
module Render = struct
|
module Render = struct
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue