Skip to content
This repository was archived by the owner on Jan 23, 2020. It is now read-only.

Add a gauge to measure the size of the build queue.#82

Merged
sjenriquez merged 1 commit into
DataDog:masterfrom
mainstreethub:queue-size-gauge
Apr 12, 2017
Merged

Add a gauge to measure the size of the build queue.#82
sjenriquez merged 1 commit into
DataDog:masterfrom
mainstreethub:queue-size-gauge

Conversation

@bbeck

@bbeck bbeck commented Mar 13, 2017

Copy link
Copy Markdown
Contributor

This gauge is periodically sampled every minute and emit a metric showing
the number of items present in the build queue.

This gauge is periodically sampled every minute and emit a metric showing
the number of items present in the build queue.
@bbeck

bbeck commented Mar 13, 2017

Copy link
Copy Markdown
Contributor Author

I looked into doing this using a QueueListener instead of PeriodicWork but felt that QueueListener had 2 major drawbacks that PeriodicWork didn't.

  1. A QueueListener is called for every transition that an item makes moving from being queued to actually executing. While totally doable to implement the plugin this way, there are 4 different states a job can transition into and in the normal case jobs transition between them very quickly. We would likely need some sort of rate limiting or throttling code to prevent from sending metrics too quickly. This would make the code more complicated without much obvious gain.

  2. Using a QueueListener implementation is great when jobs are always flowing through the system, but during times that it's idle no events would be sent. This isn't the end of the world, but for clusters that aren't very heavily loaded this could pose a problem with monitors constantly transitioning into no data states. Using PeriodicWork ensures that data is flowing even if the instance is idle.

@sjenriquez

Copy link
Copy Markdown
Contributor

@bbeck Thanks for submitting this PR along with #81, we'll take a look at these shortly.

@sjenriquez sjenriquez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @bbeck, this looks great. Going to merge, it will go out with our next release.

@sjenriquez
sjenriquez merged commit 0e13ec6 into DataDog:master Apr 12, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants