-
Notifications
You must be signed in to change notification settings - Fork 48
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
[QENG-4181] Add per-pool stats to /status
API
#162
Conversation
Prior to this the only per-pool statistics that could be extracted from the API were a list of empty pools in the "status" section of the returned results of the `/status` endpoint. This adds a new "pools" section to the '/status' results which lists, for each pool, the following results: - The number of ready vms in the pool - The number of running vms in the pool - The number of pending vms in the pool - The maximum size of the pool (as specified in the vmpooler configuration) Example: ``` { "boot": { "duration": { "average": 163.6, "min": 65.49, "max": 830.07, "total": 247744.71000000002 }, "count": { "total": 1514 } # ... "pools": { "pool1": { "ready": 5, "running": 2, "pending": 1, "max": 15 }, "pool2": { "ready": 0, "running": 10, "pending": 0, "max: 10 } } } ``` This includes spec coverage for this change (we could use more specs on `/status` in general); as well as a couple of general spec improvements.
Jruby tests having bundle install trouble (this PR didn't touch any of this): https://travis-ci.org/puppetlabs/vmpooler/jobs/158868239
|
👍 |
It's useful to be able to see, in the code, what sort of output we are generating with endpoints like `/status`.
The jruby issues might be json? Everything lately with bundler has been json. |
Digging into this a bit more, the plot thickens. The travis log shows:
Which is a bit butchered, but googling around makes me believe that the bundle error statuses are just errno statuses, and errno 28 is "No space left on device" :-/ |
0381a28
to
5a1d547
Compare
This is necessary until the bundler + Jruby issues are resolved: - rubygems/bundler#4975 - /~https://github.com/bundler/bundler/issues/4984
Put in a shim for travis until a couple of upstream bundler issues get resolved (@9b44c2ffc4a6729f61a27fe25aff5d3ac430267d) |
class API | ||
module Helpers | ||
def authenticate(auth, username_str, password_str) | ||
username_str == 'admin' and password_str == 's3cr3t' |
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.
YAS HARDCODE
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.
(I know it's a spec test but I love the jankiness of it so much)
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.
only hackers can read leet so that reduces the attack vector to hackers only
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.
copypasta :-)
I think that the jruby bundler issues may have been resolved, but haven't had time to check yet. We'll want to test and unwind the hack I have here if that's the case. |
Prior to this the only per-pool statistics that could be extracted from the API were a list of empty pools in the "status" section of the returned results of the
/status
endpoint.This adds a new "pools" section to the '/status' results which lists, for each
pool, the following results:
Example:
tasks
README.md
bundle
properly on travis (???)cc @puppetlabs/vmpooler & @puppetlabs/cinext