-
Notifications
You must be signed in to change notification settings - Fork 93
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
Only log hearbeat if status changed #529
Conversation
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.
Left a couple comments, but WFM.
I like your changes, but I would like to suggest something. The heartbeat could be logged on each call with debug level, and the state change is logged with info level. It would help a lot when a debug is needed. I'm a bit afraid no log at all could lead to problem |
@ccoVeille I don't think this will actually log less information? It just won't log if the message will be identical (because none of the log parameters changed). |
heartbeat will be silent if nothing changed. That's what your PR is about. But won't it log nothing for hours if nothing changed. Or maybe I missed something in the conditions. What will affect the count? |
@ccoVeille So I think the idea is that while yes, nothing gets logged if nothing is changing, this might be a reasonable compromise for most systems. i.e. Any systems were any jobs are moving through queues at all, you'll see logging basically the same as you did before. But for systems where nothing is happening (like in say dev), we bias towards quieter log outputs. This seems to make sense to me, although I can imagine an alternative where we should make it a Thoughts? |
Right now it will log this every five seconds, which really clobbers my terminal/logs, mostly with fairly useless debug messages: 15:27 INFO producer: Heartbeat num_completed_jobs = 0 num_jobs_running = 0 queue = default 15:27 INFO producer: Heartbeat num_completed_jobs = 0 num_jobs_running = 0 queue = default 15:27 INFO producer: Heartbeat num_completed_jobs = 0 num_jobs_running = 0 queue = default 15:27 INFO producer: Heartbeat num_completed_jobs = 0 num_jobs_running = 0 queue = default I originally considered changing the InfoContext() to DebugContext(), but doing an Info log only if the status changed seemed like a good middle ground.
Thanks! |
I'm fine and agree with what you said. I might open a PR with what I was thinking about. But my initial comment was a suggestion while the changes involved in the PR were already great. So no worries |
Right now it will log this every five seconds, which really clobbers my terminal/logs, mostly with fairly useless debug messages:
I originally considered changing the InfoContext() to DebugContext(), but doing an Info log only if the status changed seemed like a good middle ground.