-
Notifications
You must be signed in to change notification settings - Fork 218
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
Add download rate metrics for buildfarm:worker #1418
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.
approved pending nit fix
@@ -68,6 +69,9 @@ | |||
|
|||
@Log | |||
public class ShardWorkerInstance extends AbstractServerInstance { | |||
private static final Counter ioMetric = |
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.
Not static
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.
Blindly copied from ShardInstance :( removed
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.
Counter's register function appends (registers) metrics to a static instance of the CollectorRegistry.
After I modified the ioMetric variable to be non-static, the unit tests in ShardWorkerInstanceTest began to fail. This is because each test generates a fresh ShardWorkerInstance instance, and with every instance creation, it tries to register the same metrics with the CollectorRegistry again and fails with already register error.
Although buildfarm:worker at runtime only creates single instance of ShardWorkerInstance
and even making the ioMetric non-static will work but it is not configured to be singleton. Also ioMetric
need to be registered only once not per instance.
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.
@werkt Can you please merge it.
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.
Alright. We will need to get rid of the statics overall elsewhere.
Download rate metrics for worker was missing. Added metrics for worker download rate.