package opentelemetry
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Core library for instrumentation and serialization for https://opentelemetry.io
Install
dune-project
Dependency
Authors
Maintainers
Sources
opentelemetry-0.92.tbz
sha256=b635c486d1333cbb7276cc0075d5e01b017d4b37bd5941377ee1be07dfa25a45
sha512=2a19bf4e371ed2751e018c734ead2fd130d378ef0e018cda7b4aa3048af3e0db771fbd78d936199b34164950454bce0f3cb6211455e3647f7b7a85f4649bb22c
doc/src/opentelemetry.core/rand_bytes.ml.html
Source file rand_bytes.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55open struct type state = { mutable pid: int; mutable rand: Random.State.t; checks: int Atomic.t; } let key = Opentelemetry_domain.DLS.new_key (fun () -> { pid = Unix.getpid (); rand = Random.State.make_self_init (); checks = Atomic.make 3; }) let get_rand () = let self = Opentelemetry_domain.DLS.get key in if Opentelemetry_domain.is_main_domain () && Atomic.fetch_and_add self.checks (-1) <= 1 then ( (* need to check if we're in a fork. reseed to decorrelate spans/traces between parent and child *) Atomic.set self.checks 10_000; let pid = Unix.getpid () in if pid <> self.pid then ( self.rand <- Random.State.make_self_init (); self.pid <- pid ) ); self.rand end let default_rand_bytes_8 () : bytes = let rand = get_rand () in let b = Bytes.create 8 in Bytes.set_int64_le b 0 (Random.State.bits64 rand); b let default_rand_bytes_16 () : bytes = let rand = get_rand () in let b = Bytes.create 16 in Bytes.set_int64_le b 0 (Random.State.bits64 rand); Bytes.set_int64_le b 8 (Random.State.bits64 rand); b let rand_bytes_16_ref = ref default_rand_bytes_16 let rand_bytes_8_ref = ref default_rand_bytes_8 (** Generate a 16B identifier *) let[@inline] rand_bytes_16 () = !rand_bytes_16_ref () (** Generate an 8B identifier *) let[@inline] rand_bytes_8 () = !rand_bytes_8_ref ()
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>