cloudflare / pint

Prometheus rule linter/validator
https://cloudflare.github.io/pint/
Apache License 2.0
877 stars 53 forks source link

Warn about topk, bottomk and other sampling functions #1157

Closed prymitive closed 1 month ago

prymitive commented 1 month ago

Fixes #820.

github-actions[bot] commented 1 month ago

Benchmark diff:

goos: linux
goarch: amd64
pkg: github.com/cloudflare/pint/cmd/pint
cpu: AMD EPYC 7763 64-Core Processor                
              │   old.txt   │              new.txt               │
              │   sec/op    │   sec/op     vs base               │
FindEntries-4   39.28m ± 2%   39.37m ± 3%       ~ (p=0.631 n=10)
CheckRules-4     8.519 ± 2%    8.526 ± 2%       ~ (p=0.579 n=10)
geomean         578.4m        579.4m       +0.16%

              │   old.txt    │               new.txt               │
              │     B/op     │     B/op      vs base               │
FindEntries-4   27.41Mi ± 0%   27.41Mi ± 0%       ~ (p=0.190 n=10)
CheckRules-4    977.7Mi ± 0%   977.6Mi ± 0%       ~ (p=0.971 n=10)
geomean         163.7Mi        163.7Mi       -0.01%

              │   old.txt   │              new.txt               │
              │  allocs/op  │  allocs/op   vs base               │
FindEntries-4   131.9k ± 0%   131.9k ± 0%       ~ (p=0.190 n=10)
CheckRules-4    14.19M ± 0%   14.19M ± 0%       ~ (p=0.739 n=10)
geomean         1.368M        1.368M       -0.00%
codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 98.84393% with 2 lines in your changes missing coverage. Please review.

Project coverage is 94.78%. Comparing base (8856982) to head (b4490ca).

Files with missing lines Patch % Lines
internal/parser/utils/source.go 98.59% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1157 +/- ## ========================================== + Coverage 94.73% 94.78% +0.04% ========================================== Files 103 104 +1 Lines 12110 12258 +148 ========================================== + Hits 11473 11619 +146 - Misses 485 487 +2 Partials 152 152 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.