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

improve api call actions logs #4239

Merged
merged 2 commits into from
Jun 30, 2022
Merged

Conversation

bogdan-rosianu
Copy link
Contributor

before this PR, all durations of certain API actions would have been logged. this PR unifies the logging via a single function which only logs if the duration is above a threshold

@bogdan-rosianu bogdan-rosianu self-assigned this Jun 29, 2022
@ssd04 ssd04 self-requested a review June 29, 2022 08:25
ssd04
ssd04 previously approved these changes Jun 29, 2022
@miiu96
Copy link
Contributor

miiu96 commented Jun 29, 2022

Maybe you should check also in the dblookupext package if some logs can be removed or changed

@bogdan-rosianu
Copy link
Contributor Author

Maybe you should check also in the dblookupext package if some logs can be removed or changed

Checked. No occurrence

miiu96
miiu96 previously approved these changes Jun 29, 2022
gabi-vuls
gabi-vuls previously approved these changes Jun 29, 2022
Copy link
Collaborator

@gabi-vuls gabi-vuls left a comment

Choose a reason for hiding this comment

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

System test passed.

@bogdan-rosianu bogdan-rosianu changed the base branch from rc/2022-june to master June 30, 2022 07:43
@bogdan-rosianu bogdan-rosianu dismissed stale reviews from gabi-vuls, miiu96, and ssd04 June 30, 2022 07:43

The base branch was changed.

Copy link
Collaborator

@gabi-vuls gabi-vuls left a comment

Choose a reason for hiding this comment

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

System test passed

const thresholdMinAPICallDurationToLog = 200 * time.Millisecond

// LogAPIActionDurationIfNeeded will log the duration of an action triggered by an API call if it's above a threshold
func LogAPIActionDurationIfNeeded(startTime time.Time, action string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

no unit tests for this

@bogdan-rosianu bogdan-rosianu merged commit 9b05242 into master Jun 30, 2022
@bogdan-rosianu bogdan-rosianu deleted the improve-api-actions-logs branch June 30, 2022 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants