prometheus/tsdb
György Krajcsovits c26a5390aa
perf(tsdb): reuse map of sample types to speed up head appender
While investigating +10% CPU in v3.7 release, found that ~5% is from
expanding the types map. Try reuse.

Also fix a linter error.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
2025-10-06 21:44:34 +02:00
..
agent fix(wal): ignore invalid native histogram schemas on load 2025-09-24 11:41:25 +02:00
chunkenc better errors naming and formatting, typo fixes 2025-09-23 11:20:55 +02:00
chunks Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
docs docs: Fix chunk format documentation for `varint` encoding 2025-08-15 10:56:21 +02:00
encoding
errors tsdb/errors.MultiError: support errors.As (#16544) 2025-05-06 13:45:16 +00:00
fileutil Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
goversion
index Fix minor issues after applying analyzer "modernize" 2025-08-27 15:44:11 +02:00
record Update tsdb/record/record.go 2025-09-24 14:27:37 +02:00
testdata
tombstones Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
tsdbutil Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
wlog fix(wal): ignore invalid native histogram schemas on load 2025-09-24 11:41:25 +02:00
.gitignore
CHANGELOG.md
README.md
block.go add NumFloatSamples to TSDB block stats 2025-07-07 13:48:18 -07:00
block_test.go Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
blockwriter.go Upgrade to github.com/oklog/ulid/v2 (#16168) 2025-03-05 16:03:25 +01:00
blockwriter_test.go chore: enable gci linter (#16245) 2025-03-22 15:46:13 +00:00
compact.go Merge pull request #17074 from prymitive/logs 2025-09-02 12:55:12 +01:00
compact_test.go Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
db.go Log when GC / block write starts 2025-08-26 10:30:22 +01:00
db_test.go fix(wal): ignore invalid native histogram schemas on load 2025-09-24 11:41:25 +02:00
example_test.go
exemplar.go Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
exemplar_test.go Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
head.go perf(tsdb): reuse map of sample types to speed up head appender 2025-10-06 21:44:34 +02:00
head_append.go perf(tsdb): reuse map of sample types to speed up head appender 2025-10-06 21:44:34 +02:00
head_bench_test.go Create memSeries with pendingCommit=true 2025-03-27 11:11:57 +01:00
head_dedupelabels.go
head_other.go chore: enable unused-receiver rule from revive 2025-08-04 09:43:33 +00:00
head_read.go Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
head_read_test.go Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
head_test.go tsdb: Fix appended sample count metrics when converting float staleness markers to histograms (#17241) 2025-09-30 16:49:54 +00:00
head_wal.go fix(wal): ignore invalid native histogram schemas on load 2025-09-24 11:41:25 +02:00
isolation.go Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
isolation_test.go Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
mocks_test.go chore: enable unused-receiver rule from revive 2025-08-04 09:43:33 +00:00
ooo_head.go Add util/compression package to consolidate snappy/zstd use in Prometheus. (#16156) 2025-03-10 10:36:26 +00:00
ooo_head_read.go chore: enable unused-receiver rule from revive 2025-08-04 09:43:33 +00:00
ooo_head_read_test.go [PERF] TSDB: Pass down label value limit into implementation (#16158) 2025-05-06 18:54:48 +01:00
ooo_head_test.go Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
ooo_isolation.go
ooo_isolation_test.go
querier.go chore: enable unused-receiver rule from revive 2025-08-04 09:43:33 +00:00
querier_bench_test.go Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
querier_test.go Apply analyzer "modernize" to the whole codebase 2025-08-27 14:48:41 +02:00
repair.go
repair_test.go
testutil.go Fix linting issues found by golangci-lint v2.0.2 (#16368) 2025-05-03 19:05:13 +02:00
tsdbblockutil.go

README.md

TSDB

GoPkg

This directory contains the Prometheus TSDB (Time Series DataBase) library, which handles storage and querying of all Prometheus v2 data.

Documentation

External resources

A series of blog posts explaining different components of TSDB: