* Optimized very long case insensitive alternations
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Run common regexps in BenchmarkFastRegexMatcher
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Modify BenchmarkNewFastRegexMatcher to benchmark the NewFastRegexMatcher() function
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Reduced allocations by optimizeEqualStringMatchers()
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Fixed typo in comments
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Fixed typo in test case name
Signed-off-by: Marco Pracucci <marco@pracucci.com>
---------
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Do not optimize regexps with being/end text anchors inside
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Explicit case for begin/end text in stringMatcherFromRegexpInternal()
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Added more test cases
Signed-off-by: Marco Pracucci <marco@pracucci.com>
---------
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Optimized FastRegexMatcher when the regex contains a case insensitive alternation made with concats too
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Do not use a pointer to hold whether the matches are case sensitive
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Improved unit tests based on review feedback
Signed-off-by: Marco Pracucci <marco@pracucci.com>
---------
Signed-off-by: Marco Pracucci <marco@pracucci.com>
* Export single ith test histogram generation functions
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
* Do not set counter reset hint for non-gauge histograms individually
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
* Apply suggestions from code review
Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
Signed-off-by: George Krajcsovits <krajorama@users.noreply.github.com>
---------
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: George Krajcsovits <krajorama@users.noreply.github.com>
Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
* Add initial sketch of Codec interface.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
* Introduce JSON codec.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
* Expose Response type so that consuming applications (eg. Mimir) can implement their own Codecs.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
* Add sketch of what supporting different codecs could look like.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
* Rename fallbackCodec to defaultCodec.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
* Remove defaultCodec as a field on API.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
* Rename AddCodec() and clarify expected behaviour.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
* Modify TestRespond to test JsonCodec directly.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
* Refactor existing respond() test in preparation for content negotiation test cases.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
* Add tests for content negotiation.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
* Add missing documentation comments.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
* Add another test case.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
* Rename JsonCodec to JSONCodec.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
* Fix linting issue.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
* Fallback to JSON codec if no acceptable codec can be found for the Accept header.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
* Move custom jsoniter code into json_codec.go.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
---------
Signed-off-by: Charles Korn <charles.korn@grafana.com>
* Correct statement in docs about query results returning either floats or histograms but not both.
* Move documentation for range and instant vectors under their corresponding headings.
Signed-off-by: Charles Korn <charles.korn@grafana.com>
* tsdb: make sharding function a parameter
Instead of relying on `labels.Hash()`, which may change, have the
caller pass in a shard function if required.
For most purposes `tsdb.Options.ShardFunc` is used, but the compactor
may be created independently so `NewLeveledCompactorWithChunkSize` also
takes a shard function parameter.
Regular Prometheus, which does not use block sharding, will have this
parameter as nil.
Rename WithCache functions as WithOptions
Where they now have 2 or more extra parameters.
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>