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

Logging Worker Execution Times Only if Limit Exceeded #1604

Merged
merged 6 commits into from
Jan 7, 2025

Conversation

ralikio
Copy link
Member

@ralikio ralikio commented Jan 2, 2025

Removing execution time for given worker in removeTimeIfInWarnMargin function to track only workers that exceed allowed margin time. Added additional workerLastKeys map to keep worker keys for logging in worker summary go routine.

Description

Changes proposed in this pull request:

  • Removing execution time for given worker in removeTimeIfInWarnMargin function to track only workers that exceed allowed margin time.
  • Added additional workerLastKeys map to keep worker keys for logging in worker summary go routine.

Related issue(s)

#1473

Removing execution time for given worker in removeTimeIfInWarnMargin function to track only workers that exceed allowed margin time. Added additional workerLastKeys map to keep worker keys for logging in worker summary go routine.
@kyma-bot kyma-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cla: yes Indicates the PR's author has signed the CLA. labels Jan 2, 2025
Copy link

github-actions bot commented Jan 2, 2025

Add one of following labels

- kind/feature -> Use it when you want to submit a new feature

- kind/enhancement -> Use it when you modify or improve an existing feature

- kind/bug -> Use it when you fix a bug

@kyma-bot kyma-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 2, 2025
@ralikio ralikio marked this pull request as ready for review January 2, 2025 12:02
@ralikio ralikio requested a review from a team as a code owner January 2, 2025 12:02
@kyma-bot kyma-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 2, 2025
@kyma-gopher-bot kyma-gopher-bot enabled auto-merge (squash) January 2, 2025 12:02
@ralikio ralikio added the kind/bug Categorizes issue or PR as related to a bug. label Jan 2, 2025
@piotrmiskiewicz piotrmiskiewicz self-requested a review January 2, 2025 12:47

processingTime := time.Since(processingStart)

if processingTime > q.warnAfterTime {
Copy link
Contributor

Choose a reason for hiding this comment

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

Will we log here information when the worker is idle?
In case there is nothing in the queue to process for a long time so the last execution time (in q.workerExecutionTimes[workerNameId] is very old.

Copy link
Member Author

Choose a reason for hiding this comment

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

In the case the time from workerExecutionTimes is removed in https://github.com/kyma-project/kyma-environment-broker/pull/1604/files#diff-e94ea6ee51e7a52f24c56388c5828851ee956a6cb5d30cf83a6a82cef2f7784cR119 before a chance to log it hence not producing idle logs.

Copy link
Member Author

Choose a reason for hiding this comment

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

Iddle logs were produced in the healthcheck go routine.

@ralikio ralikio self-assigned this Jan 3, 2025
Remove times only one time in the code.
@kyma-gopher-bot kyma-gopher-bot merged commit 599f8f5 into main Jan 7, 2025
26 checks passed
@kyma-bot kyma-bot added the lgtm Looks good to me! label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indicates the PR's author has signed the CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm Looks good to me! size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants