-
Notifications
You must be signed in to change notification settings - Fork 70
measure UserSignup provision time #1148
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
Merged
MatousJobanek
merged 8 commits into
codeready-toolchain:master
from
MatousJobanek:measure-provision-time
Feb 27, 2025
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b3b6279
measure UserSignup provision time
MatousJobanek ec07825
go mod tidy
MatousJobanek 84c6983
wait until mur is ready
MatousJobanek dd27eb6
Merge branch 'master' into measure-provision-time
MatousJobanek 97eeacf
drop redundant test
MatousJobanek 7111164
format
MatousJobanek 4ef1a26
improve
MatousJobanek 612e006
update deps
MatousJobanek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor - should we delete at the end? once the provisionTimeSeconds was computed. Just in case something goes wrong in the middle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was thinking about it too. For the simplicity, I decided to delete it and log the information. In this case, the presence of the annotation says if the given UserSignup was already recorded or not. If we would want to keep it, then we would need to add another field into UserSignup.Status to store the provision time.
Both options are valid, I decided to go with the simpler one. We can always change it later.
But if there would be more people asking for having the information stored in UserSignup, then I can do it in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry , I was just wondering if we should move those lines after line 427, not keeping the information. Just move it as last thing in the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, gotcha.
I used this order intentionally to ensure that the provision time for the particular UserSignup will be recorded only once. If the update fails (because of a conflict) then the controller requeue a new reconcile and try to remove the annotation again. With this approach, the provision time will be recorded only when the removal of the annotation is successful. If the removal was at the end of the function and the update failed, then we would have two records for the same UserSignup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotcha, makes sense! thanks for explaining that!
I was thinking about the case in which fails after the update and before the recording ( basically parsing the value ). But I think that is tolerated, more than having duplicated recordings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it fails for parsing the value, then there is some problem between reg-service and host-operator and we should only log the error and not return it nor try to parse it again. The resulting duration would be irrelevant and we shouldn't block the UserSignup because of some broken telemetry data.