~/talk

Lock-free Observations for Prometheus Histograms

Talkat GopherCon UK 2019 · 2019-08-21..08-23· [concurrency]
slides:none on file

Shows how Prometheus histograms get near lock-free updates by using the atomic package to write into a hot buffer while reads snapshot a cold buffer, switching them by atomically flipping a packed 64-bit word that holds a counter and a 1-bit index (63-bit packing). Unit tests run a million iterations and expose a flaky failure caused by 64-bit alignment and slice layout on 32-bit platforms, fixed by heap-allocating the counters, after which the approach reliably works.

AI-written summary · about

  1. 0:00Start
  2. 16:00Write method part 1
  3. 17:26attempt 1: Wait for cool-down
  4. 22:19Lock-free observe revised
  5. 23:13Write method revised
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.