Re:Nanolog supports logging with 7 ns median latency
by pas on Friday August 23, 2024 @12:17PM
(#41330275)
probably in this case it's important to use some kind of synthetic timestamping to preserve the ordering (for example, for a 5.123 [ms] timestamp one can add ~1000000 ns timestamps, so let's say are a thousand entries that need to be ordered, one can then represent them as 5.123000[n] ... and the "000" part is just a silly in-band way to give a hint to someone who will later examine the logs)
[ Parent
| on HN ]
Re:Nanolog supports logging with 7 ns median latency
by jnordwick on Friday August 23, 2024 @02:21PM
(#41331562)
since you aren't going to be writing a message per nanosecond, you can always just do `last nanos = max(last nanos + 1, cur nanos)` and then use last nanos for the timestamp. you can even do it in rdtsc ticks and get 1/3 of nano values. Obv the clock isn't nearly that accurate, but it lets you use those fractional nanos to ensure a strictly increasing ordering.