mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-12 16:44:05 -08:00
259847a6b1
* Add unittests for PostingsForMatcher. * Selector methods are all stateless, don't need a reference. * Be smarter in how we look at matchers. Look at all matchers to see if a label can be empty. Optimise Not handling, so i!="2" is a simple lookup rather than an inverse postings list. All all the Withouts together, rather than having to subtract each from all postings. Change the pre-expand the postings logic to always do it before doing a Without only. Don't do that if it's already a list. The initial goal here was that the oft-seen pattern i=~"something.+",i!="foo",i!="bar" becomes more efficient. benchmark old ns/op new ns/op delta BenchmarkHeadPostingForMatchers/n="1"-4 5888 6160 +4.62% BenchmarkHeadPostingForMatchers/n="1",j="foo"-4 7190 6640 -7.65% BenchmarkHeadPostingForMatchers/j="foo",n="1"-4 6038 5923 -1.90% BenchmarkHeadPostingForMatchers/n="1",j!="foo"-4 6030884 4850525 -19.57% BenchmarkHeadPostingForMatchers/i=~".*"-4 887377940 230329137 -74.04% BenchmarkHeadPostingForMatchers/i=~".+"-4 490316101 319931758 -34.75% BenchmarkHeadPostingForMatchers/i=~""-4 594961991 130279313 -78.10% BenchmarkHeadPostingForMatchers/i!=""-4 537542388 318751015 -40.70% BenchmarkHeadPostingForMatchers/n="1",i=~".*",j="foo"-4 10460243 8565195 -18.12% BenchmarkHeadPostingForMatchers/n="1",i=~".*",i!="2",j="foo"-4 44964267 8561546 -80.96% BenchmarkHeadPostingForMatchers/n="1",i!="",j="foo"-4 42244885 29137737 -31.03% BenchmarkHeadPostingForMatchers/n="1",i=~".+",j="foo"-4 35285834 32774584 -7.12% BenchmarkHeadPostingForMatchers/n="1",i=~"1.+",j="foo"-4 8951047 8379024 -6.39% BenchmarkHeadPostingForMatchers/n="1",i=~".+",i!="2",j="foo"-4 63813335 30672688 -51.93% BenchmarkHeadPostingForMatchers/n="1",i=~".+",i!~"2.*",j="foo"-4 45381112 44924397 -1.01% Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
4 KiB
4 KiB
master / unreleased
- [CHANGE] tsdb now requires golang 1.12 or higher.
- [REMOVED]
chunks.NewReader
is removed as it wasn't used anywhere. - [REMOVED]
FromData
is considered unused so was removed. - [FEATURE] Added option WALSegmentSize -1 to disable the WAL.
- [BUGFIX] Bugfix in selectOverlappingDirs. Only return the first overlapping blocks.
- [BUGFIX] Fsync the meta file to persist it on disk to avoid data loss in case of a host crash.
- [BUGFIX] Fix fd and vm_area leak on error path in chunks.NewDirReader.
- [BUGFIX] Fix fd and vm_area leak on error path in index.NewFileReader.
- [ENHANCEMENT] Be smarter in how we look at matchers.
- [ENHANCEMENT] PostListings and NotMatcher now public.
0.6.1
- [BUGFIX] Update
last
after appending a non-overlapping chunk inchunks.MergeOverlappingChunks
. #539
0.6.0
- [CHANGE]
AllowOverlappingBlock
is nowAllowOverlappingBlocks
.
0.5.0
- [FEATURE] Time-ovelapping blocks are now allowed. #370
- Disabled by default and can be enabled via
AllowOverlappingBlock
option. - Added
MergeChunks
function inchunkenc/xor.go
to merge 2 time-overlapping chunks. - Added
MergeOverlappingChunks
function inchunks/chunks.go
to merge multiple time-overlapping Chunk Metas. - Added
MinTime
andMaxTime
method forBlockReader
.
- Disabled by default and can be enabled via
- [FEATURE] New
dump
command to tsdb tool to dump all samples. - [FEATURE] New
encoding
package for common binary encoding/decoding helpers.- Added to remove some code duplication.
- [ENHANCEMENT] When closing the db any running compaction will be cancelled so it doesn't block.
NewLeveledCompactor
takes a context.
- [CHANGE]
prometheus_tsdb_storage_blocks_bytes_total
is nowprometheus_tsdb_storage_blocks_bytes
. - [BUGFIX] Improved Postings Merge performance. Fixes a regression from the the previous release.
- [BUGFIX] LiveReader can get into an infinite loop on corrupt WALs.
0.4.0
- [CHANGE] New
WALSegmentSize
option to override theDefaultOptions.WALSegmentSize
. Added to allow using smaller wal files. For example using tmpfs on a RPI to minimise the SD card wear out from the constant WAL writes. As part of this change theDefaultOptions.WALSegmentSize
constant was also exposed. - [CHANGE] Empty blocks are not written during compaction #374
- [FEATURE] Size base retention through
Options.MaxBytes
. As part of this change:- Added new metrics -
prometheus_tsdb_storage_blocks_bytes_total
,prometheus_tsdb_size_retentions_total
,prometheus_tsdb_time_retentions_total
- New public interface
SizeReader: Size() int64
OpenBlock
signature changed to take a logger.
- Added new metrics -
- [REMOVED]
PrefixMatcher
is considered unused so was removed. - [CLEANUP]
Options.WALFlushInterval
is removed as it wasn't used anywhere. - [FEATURE] Add new
LiveReader
to WAL pacakge. Added to allow live tailing of a WAL segment, used by Prometheus Remote Write after refactor. The main difference between the new reader and the existingReader
is that forLiveReader
a call toNext()
that returns false does not mean that there will never be more data to read.
0.3.1
- [BUGFIX] Fixed most windows test and some actual bugs for unclosed file readers.
0.3.0
- [CHANGE]
LastCheckpoint()
used to return just the segment name and now it returns the full relative path. - [CHANGE]
NewSegmentsRangeReader()
can now read over miltiple wal ranges by using the newSegmentRange{}
struct. - [CHANGE]
CorruptionErr{}
now also exposes the SegmentDir
which is added when displaying any errors. - [CHANGE]
Head.Init()
is changed toHead.Init(minValidTime int64)
- [CHANGE]
SymbolTable()
renamed toSymbolTableSize()
to make the name consistent with theBlock{ symbolTableSize uint64 }
field. - [CHANGE]
wal.Reader{}
now exposesSegment()
for the current segment being read andOffset()
for the current offset. - [FEATURE] tsdbutil analyze subcomand to find churn, high cardinality, etc.