mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
136956cca4
This is an optimization on the existing append in OOOChunk. What we've been doing so far is find the place inside the out-of-order slice where the new sample should go in and then place it there and move any samples to the right if necessary. This is OK but requires a binary search every time the slice is bigger than 0. The optimization is opinionated and suggests that although out-of-order samples can be out-of-order amongst themselves they'll probably be in order thus we can probably optimistically append at the end and if not do the binary search. OOOChunks are capped to 30 samples by default so this is a small optimization but everything adds up, specially if you handle many active timeseries with out-of-order samples. Signed-off-by: Jesus Vazquez <jesus.vazquez@grafana.com> Signed-off-by: Jesus Vazquez <jesusvazquez@users.noreply.github.com> Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com> |
||
---|---|---|
.. | ||
chunked.go | ||
chunked_test.go | ||
client.go | ||
client_test.go | ||
codec.go | ||
codec_test.go | ||
ewma.go | ||
intern.go | ||
intern_test.go | ||
max_timestamp.go | ||
metadata_watcher.go | ||
metadata_watcher_test.go | ||
queue_manager.go | ||
queue_manager_test.go | ||
read.go | ||
read_handler.go | ||
read_handler_test.go | ||
read_test.go | ||
storage.go | ||
storage_test.go | ||
write.go | ||
write_handler.go | ||
write_handler_test.go | ||
write_test.go |