-
Notifications
You must be signed in to change notification settings - Fork 54
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
Moved collector into subpackage with tests #22
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.
👏🏼
agents := v.([]bk.Agent) | ||
|
||
for _, agent := range agents { | ||
queue := "default" |
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.
An agent can have multiple queues. I have this bug too in the new queues API endpoint, so the numbers were a little off. We'll need to fix that here too.
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.
ORLY? That's interesting. I will keep this behaviour in currently and look to fix it in a subsequent PR.
func New(c *bk.Client, opts Opts) *Collector { | ||
return &Collector{ | ||
Opts: opts, | ||
buildService: c.Builds, |
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.
Just noticed this in my local copy (I'm doing a fork to add statsd support): should agentService
be populated too?
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.
Hrm, good point, now to figure out how it works at all.
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.
Just working on a PR
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.
Turns out not having tests sucks, as does having loads of code in the main package. This remedies both of these things to a minimal extent.