Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(minor): Support thresholds for absolute checks #223

Merged
merged 7 commits into from
Jan 11, 2024

Conversation

hassila
Copy link
Contributor

@hassila hassila commented Jan 11, 2024

Description

For benchmarks that are not completely stable (in e.g. syscall/malloc count) due to use of e.g. async or networking, it is desirable to also be able to specify some leeway for benchmarks even for the absolute checks from thresholds.

This fixes #220

By default the behaviour for absolute thresholds checks are as previously (strict, zero improvements/regressions are allowed), but now it is possible to define both absolute and relative thresholds for the benchmarks (as documented at https://swiftpackageindex.com/ordo-one/package-benchmark/1.21.3/documentation/benchmark/writingbenchmarks)

How Has This Been Tested?

Manual testing.

Minimal checklist:

  • I have performed a self-review of my own code
  • I have added DocC code-level documentation for any public interfaces exported by the package
  • I have added unit and/or integration tests that prove my fix is effective or that my feature works

@hassila hassila force-pushed the support-thresholds-for-absolute-checks branch from 1f6d808 to c1fb546 Compare January 11, 2024 08:41
Copy link

codecov bot commented Jan 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (02b4da9) 67.18% compared to head (1db45b5) 66.84%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #223      +/-   ##
==========================================
- Coverage   67.18%   66.84%   -0.35%     
==========================================
  Files          34       33       -1     
  Lines        4376     4303      -73     
==========================================
- Hits         2940     2876      -64     
+ Misses       1436     1427       -9     
Files Coverage Δ
Sources/Benchmark/BenchmarkClock.swift 33.72% <ø> (ø)
Sources/Benchmark/BenchmarkMetric+Defaults.swift 36.79% <ø> (ø)
Sources/Benchmark/BenchmarkResult.swift 72.24% <100.00%> (-0.82%) ⬇️
Sources/Benchmark/Progress/Progress.swift 57.41% <ø> (ø)
Sources/Benchmark/Progress/ProgressElements.swift 92.42% <ø> (ø)
Sources/Benchmark/Progress/Utilities.swift 59.52% <ø> (ø)
Sources/Benchmark/Statistics.swift 72.03% <ø> (ø)
Tests/BenchmarkTests/BenchmarkResultTests.swift 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

Files Coverage Δ
Sources/Benchmark/BenchmarkClock.swift 33.72% <ø> (ø)
Sources/Benchmark/BenchmarkMetric+Defaults.swift 36.79% <ø> (ø)
Sources/Benchmark/BenchmarkResult.swift 72.24% <100.00%> (-0.82%) ⬇️
Sources/Benchmark/Progress/Progress.swift 57.41% <ø> (ø)
Sources/Benchmark/Progress/ProgressElements.swift 92.42% <ø> (ø)
Sources/Benchmark/Progress/Utilities.swift 59.52% <ø> (ø)
Sources/Benchmark/Statistics.swift 72.03% <ø> (ø)
Tests/BenchmarkTests/BenchmarkResultTests.swift 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 02b4da9...1db45b5. Read the comment docs.

Copy link
Contributor

github-actions bot commented Jan 11, 2024

…swift

Co-authored-by: dimlio <122263440+dimlio@users.noreply.github.com>
@hassila hassila merged commit 3bb4e7d into main Jan 11, 2024
12 of 16 checks passed
@hassila hassila deleted the support-thresholds-for-absolute-checks branch January 11, 2024 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Support absolute/relative thresholds deviation configurations for --check-absolute too
3 participants