cloudflare / pint

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

Add a JSON reporter #1169

Closed prymitive closed 1 month ago

prymitive commented 1 month ago

Fixes #606.

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.63m ± 1%   40.30m ± 1%  +1.70% (p=0.003 n=10)
CheckRules-4     8.490 ± 2%    8.531 ± 2%       ~ (p=0.315 n=10)
geomean         580.1m        586.4m       +1.09%

              │   old.txt    │               new.txt               │
              │     B/op     │     B/op      vs base               │
FindEntries-4   27.41Mi ± 0%   27.41Mi ± 0%       ~ (p=0.579 n=10)
CheckRules-4    987.6Mi ± 0%   986.8Mi ± 0%       ~ (p=0.218 n=10)
geomean         164.5Mi        164.5Mi       -0.04%

              │   old.txt   │              new.txt               │
              │  allocs/op  │  allocs/op   vs base               │
FindEntries-4   131.9k ± 0%   131.9k ± 0%       ~ (p=0.071 n=10)
CheckRules-4    14.30M ± 0%   14.29M ± 0%       ~ (p=0.247 n=10)
geomean         1.373M        1.373M       -0.01%
codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 89.83051% with 6 lines in your changes missing coverage. Please review.

Project coverage is 94.79%. Comparing base (95af10f) to head (45d90da).

Files with missing lines Patch % Lines
internal/reporter/console.go 73.91% 4 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1169 +/- ## ========================================== - Coverage 94.80% 94.79% -0.01% ========================================== Files 103 104 +1 Lines 12168 12207 +39 ========================================== + Hits 11536 11572 +36 - Misses 482 484 +2 - Partials 150 151 +1 ```

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