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(analysis): Add Measurements Length Option for Dry-Run Metrics #1715

Closed
wants to merge 1 commit into from

Conversation

agrawroh
Copy link
Member

@agrawroh agrawroh commented Dec 15, 2021

Description

It could be very useful to retain the maximum data points while running an analysis in the dry-run mode to understand what caused a particular metric to error out or why the final result came out as inconclusive.

Currently, the controller only retains the ten latest measurements and it's not possible to configure/change this value as its hard-coded in the code.

Changes

This PR adds a new option called measurementsLength in the dryRun which can be used to retain other than the latest ten results for the metrics running in the dry-run mode. Setting this option to 0 would disable it and, the controller will revert back to the existing behavior of retaining the latest ten measurements.

Checklist

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I've signed my commits with DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My builds are green. Try syncing with master if they are not.
  • My organization is added to USERS.md.

Signed-off-by: Rohit Agrawal [email protected]

@codecov
Copy link

codecov bot commented Dec 15, 2021

Codecov Report

Merging #1715 (e273eac) into master (061efd4) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1715      +/-   ##
==========================================
+ Coverage   82.04%   82.05%   +0.01%     
==========================================
  Files         116      116              
  Lines       16065    16074       +9     
==========================================
+ Hits        13181    13190       +9     
  Misses       2212     2212              
  Partials      672      672              
Impacted Files Coverage Δ
analysis/analysis.go 85.86% <100.00%> (+0.12%) ⬆️
controller/metrics/analysis.go 88.31% <100.00%> (+0.64%) ⬆️
utils/analysis/helpers.go 77.93% <100.00%> (ø)

Continue to review full report at Codecov.

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

@agrawroh agrawroh force-pushed the dry-run-gc branch 2 times, most recently from 8882375 to 22e5ba4 Compare December 15, 2021 06:58
@sonarcloud
Copy link

sonarcloud bot commented Dec 15, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
7.1% 7.1% Duplication

Copy link
Member

@jessesuen jessesuen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree the measurement retention limit should be modifiable. But I also don't think we should limit it to dryRun. So I suggest the following changes:

  1. suggest the field name to be: measurementRetention (which is more clear than length)
  2. add this to AnalysisRun spec instead of spec.dryRun.
  3. Have a similar UX for configuring the retention for different metrics. e.g.:

Retain 20 measurements for each metric:

spec:
  measurementRetention:
  - metricName: .*
    limit: 20

retain 20 success-rate measurements:

spec:
  measurementRetention:
  - metricName: success-rate
    limit: 20

These would apply to either dry runs or wet runs.

@jessesuen
Copy link
Member

Closing since superseded by #1729

@jessesuen jessesuen closed this Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-review Ready for final review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants