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(controller)!: Updates the resource duration calculation. Fixes #2934 #2937

Merged
merged 13 commits into from
May 12, 2020

Conversation

alexec
Copy link
Contributor

@alexec alexec commented May 3, 2020

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 the CLA.
  • 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.

Fixes #2934

Changes

  • This now defaults one and the config item name is changed.
  • The denominator for memory is now 100Mi rather than 1Gi so smaller memory usages are calculated.
  • I fixed a bug in the calculation.
  • The denominator is displayed in the UI.

Screenshots

Screen Shot 2020-05-03 at 1 34 01 PM
Screen Shot 2020-05-03 at 1 35 48 PM

@alexec
Copy link
Contributor Author

alexec commented May 3, 2020

@elgalu, @gaigepr, @seichten, @lemor303442, @paguos, @goern, @wangadong, @phelinor, @ddseapy, @zhujl1991 can I please request your feedback on this change?

@alexec alexec changed the title feat: Updates the resource duration calculation. Fixes #2934 feat(controller)!: Updates the resource duration calculation. Fixes #2934 May 4, 2020
@alexec
Copy link
Contributor Author

alexec commented May 5, 2020

@elgalu, @gaigepr, @seichten, @lemor303442, @paguos, @goern, @wangadong, @phelinor, @zhujl1991 bump!

@alexec alexec marked this pull request as ready for review May 5, 2020 23:26
@@ -56,9 +56,6 @@ type Config struct {
// MetricsConfig specifies configuration for metrics emission
MetricsConfig PrometheusConfig `json:"metricsConfig,omitempty"`

// FeatureFlags for general/experimental features
FeatureFlags FeatureFlags `json:"featureFlags,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Are we getting rid of feature flags entirely? Wouldn't we want to keep this for future features?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it is bad design. You can use normal config item or a envvar? Both are easier and more flexible.

Copy link
Member

Choose a reason for hiding this comment

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

Are we enabling resource duration by default?

docs/resource-duration.md Outdated Show resolved Hide resolved
@@ -978,7 +979,7 @@ func (in ResourcesDuration) Add(o ResourcesDuration) ResourcesDuration {
func (in ResourcesDuration) String() string {
var parts []string
for n, d := range in {
parts = append(parts, fmt.Sprintf("%v*%s", d, n))
parts = append(parts, fmt.Sprintf("%v*(%s %s)", d, ResourceQuantityDenominator(n).String(), n))
Copy link
Member

Choose a reason for hiding this comment

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

This looks way better in my opinion

@alexec alexec added type/feature Feature request and removed needs-discussion labels May 12, 2020
Copy link
Member

@sarabala1979 sarabala1979 left a comment

Choose a reason for hiding this comment

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

LGMT

@sonarcloud
Copy link

sonarcloud bot commented May 12, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

92.0% 92.0% Coverage
0.0% 0.0% Duplication

@alexec alexec merged commit d5d6f75 into argoproj:master May 12, 2020
@alexec alexec deleted the feat-rd branch May 12, 2020 16:35
alexec added a commit to alexec/argo-workflows that referenced this pull request May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature Feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhanced resource duration
4 participants