{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/vmpooler/pulls/comments/66192387","id":66192387,"diff_hunk":"@@ -400,8 +423,16 @@ def extract_templates_from_query_params(params)\n       content_type :json\n       result = { 'ok' => false }\n \n-      if payload and !payload.empty?\n-        result = atomically_allocate_vms(payload)\n+      if payload\n+        empty = payload.delete('empty')\n+        invalid = payload.delete('invalid')\n+        statsd.increment(statsd_prefix + '.checkout.empty', empty) if !empty.nil?\n+        statsd.increment(statsd_prefix + '.checkout.invalid', invalid) if !invalid.nil?\n+        if !payload.empty?\n+          result = atomically_allocate_vms(payload)\n+        else\n+          status 404\n+        end","path":"lib/vmpooler/api/v1.rb","position":83,"original_position":83,"commit_id":"b9834720883283e4031e617b11be2ac5300839d2","original_commit_id":"b9834720883283e4031e617b11be2ac5300839d2","user":{"login":"mckern","id":344926,"avatar_url":"https://avatars.githubusercontent.com/u/344926?v=3","gravatar_id":"","url":"https://api.github.com/users/mckern","html_url":"https://github.com/mckern","followers_url":"https://api.github.com/users/mckern/followers","following_url":"https://api.github.com/users/mckern/following{/other_user}","gists_url":"https://api.github.com/users/mckern/gists{/gist_id}","starred_url":"https://api.github.com/users/mckern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mckern/subscriptions","organizations_url":"https://api.github.com/users/mckern/orgs","repos_url":"https://api.github.com/users/mckern/repos","events_url":"https://api.github.com/users/mckern/events{/privacy}","received_events_url":"https://api.github.com/users/mckern/received_events","type":"User","site_admin":false},"body":"See like, the last 3 or 4 comments re: simplifying some of lines 426 through 435 (`unless`, `#nil?`, truthiness, etc.).","created_at":"2016-06-08T04:57:11Z","updated_at":"2016-06-08T04:57:11Z","html_url":"https://github.com/puppetlabs/vmpooler/pull/155#discussion_r66192387","pull_request_url":"https://api.github.com/repos/puppetlabs/vmpooler/pulls/155","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/vmpooler/pulls/comments/66192387"},"html":{"href":"https://github.com/puppetlabs/vmpooler/pull/155#discussion_r66192387"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/vmpooler/pulls/155"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/vmpooler/pulls/155","id":72983939,"html_url":"https://github.com/puppetlabs/vmpooler/pull/155","diff_url":"https://github.com/puppetlabs/vmpooler/pull/155.diff","patch_url":"https://github.com/puppetlabs/vmpooler/pull/155.patch","issue_url":"https://api.github.com/repos/puppetlabs/vmpooler/issues/155","number":155,"state":"open","locked":false,"title":"(RE-7014) add statsd support","user":{"login":"shermdog","id":3383063,"avatar_url":"https://avatars.githubusercontent.com/u/3383063?v=3","gravatar_id":"","url":"https://api.github.com/users/shermdog","html_url":"https://github.com/shermdog","followers_url":"https://api.github.com/users/shermdog/followers","following_url":"https://api.github.com/users/shermdog/following{/other_user}","gists_url":"https://api.github.com/users/shermdog/gists{/gist_id}","starred_url":"https://api.github.com/users/shermdog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shermdog/subscriptions","organizations_url":"https://api.github.com/users/shermdog/orgs","repos_url":"https://api.github.com/users/shermdog/repos","events_url":"https://api.github.com/users/shermdog/events{/privacy}","received_events_url":"https://api.github.com/users/shermdog/received_events","type":"User","site_admin":false},"body":"Add the tracking of running, ready, and clone time for VM\r\nAdd the tracking of of successful, failed, invalid, and empty pool vm gets.\r\n\r\nIt is possible we may want to tweak this, but have validated with spec tests and pcaps.\r\n\r\n```\r\nvmpooler-tmp-dev.ready.debian-7-x86_64:1|c\r\nvmpooler-tmp-dev.running.debian-7-x86_64:1|c\r\n\r\nvmpooler-tmp-dev.checkout.invalid:1|c\r\nvmpooler-tmp-dev.checkout.success.debian-7-x86_64:1|c\r\nvmpooler-tmp-dev.checkout.empty:1|c\r\n\r\nvmpooler-tmp-dev.running.debian-7-x86_64:1|c\r\n\r\nvmpooler-tmp-dev.clone.debian-7-x86_64:12.10|ms\r\n\r\nvmpooler-tmp-dev.ready.debian-7-x86_64:1|c\r\n```","created_at":"2016-06-08T04:05:31Z","updated_at":"2016-06-08T04:57:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eaa0fa34bd325e172b11b1aff5a89622acb99fea","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/vmpooler/pulls/155/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/vmpooler/pulls/155/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/vmpooler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/vmpooler/issues/155/comments","statuses_url":"https://api.github.com/repos/puppetlabs/vmpooler/statuses/b9834720883283e4031e617b11be2ac5300839d2","head":{"label":"shermdog:RE-7014-cinext","ref":"RE-7014-cinext","sha":"b9834720883283e4031e617b11be2ac5300839d2","user":{"login":"shermdog","id":3383063,"avatar_url":"https://avatars.githubusercontent.com/u/3383063?v=3","gravatar_id":"","url":"https://api.github.com/users/shermdog","html_url":"https://github.com/shermdog","followers_url":"https://api.github.com/users/shermdog/followers","following_url":"https://api.github.com/users/shermdog/following{/other_user}","gists_url":"https://api.github.com/users/shermdog/gists{/gist_id}","starred_url":"https://api.github.com/users/shermdog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shermdog/subscriptions","organizations_url":"https://api.github.com/users/shermdog/orgs","repos_url":"https://api.github.com/users/shermdog/repos","events_url":"https://api.github.com/users/shermdog/events{/privacy}","received_events_url":"https://api.github.com/users/shermdog/received_events","type":"User","site_admin":false},"repo":{"id":49527468,"name":"vmpooler","full_name":"shermdog/vmpooler","owner":{"login":"shermdog","id":3383063,"avatar_url":"https://avatars.githubusercontent.com/u/3383063?v=3","gravatar_id":"","url":"https://api.github.com/users/shermdog","html_url":"https://github.com/shermdog","followers_url":"https://api.github.com/users/shermdog/followers","following_url":"https://api.github.com/users/shermdog/following{/other_user}","gists_url":"https://api.github.com/users/shermdog/gists{/gist_id}","starred_url":"https://api.github.com/users/shermdog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shermdog/subscriptions","organizations_url":"https://api.github.com/users/shermdog/orgs","repos_url":"https://api.github.com/users/shermdog/repos","events_url":"https://api.github.com/users/shermdog/events{/privacy}","received_events_url":"https://api.github.com/users/shermdog/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shermdog/vmpooler","description":"Provide configurable 'pools' of instantly-available (running) virtual machines","fork":true,"url":"https://api.github.com/repos/shermdog/vmpooler","forks_url":"https://api.github.com/repos/shermdog/vmpooler/forks","keys_url":"https://api.github.com/repos/shermdog/vmpooler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shermdog/vmpooler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shermdog/vmpooler/teams","hooks_url":"https://api.github.com/repos/shermdog/vmpooler/hooks","issue_events_url":"https://api.github.com/repos/shermdog/vmpooler/issues/events{/number}","events_url":"https://api.github.com/repos/shermdog/vmpooler/events","assignees_url":"https://api.github.com/repos/shermdog/vmpooler/assignees{/user}","branches_url":"https://api.github.com/repos/shermdog/vmpooler/branches{/branch}","tags_url":"https://api.github.com/repos/shermdog/vmpooler/tags","blobs_url":"https://api.github.com/repos/shermdog/vmpooler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shermdog/vmpooler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shermdog/vmpooler/git/refs{/sha}","trees_url":"https://api.github.com/repos/shermdog/vmpooler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shermdog/vmpooler/statuses/{sha}","languages_url":"https://api.github.com/repos/shermdog/vmpooler/languages","stargazers_url":"https://api.github.com/repos/shermdog/vmpooler/stargazers","contributors_url":"https://api.github.com/repos/shermdog/vmpooler/contributors","subscribers_url":"https://api.github.com/repos/shermdog/vmpooler/subscribers","subscription_url":"https://api.github.com/repos/shermdog/vmpooler/subscription","commits_url":"https://api.github.com/repos/shermdog/vmpooler/commits{/sha}","git_commits_url":"https://api.github.com/repos/shermdog/vmpooler/git/commits{/sha}","comments_url":"https://api.github.com/repos/shermdog/vmpooler/comments{/number}","issue_comment_url":"https://api.github.com/repos/shermdog/vmpooler/issues/comments{/number}","contents_url":"https://api.github.com/repos/shermdog/vmpooler/contents/{+path}","compare_url":"https://api.github.com/repos/shermdog/vmpooler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shermdog/vmpooler/merges","archive_url":"https://api.github.com/repos/shermdog/vmpooler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shermdog/vmpooler/downloads","issues_url":"https://api.github.com/repos/shermdog/vmpooler/issues{/number}","pulls_url":"https://api.github.com/repos/shermdog/vmpooler/pulls{/number}","milestones_url":"https://api.github.com/repos/shermdog/vmpooler/milestones{/number}","notifications_url":"https://api.github.com/repos/shermdog/vmpooler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shermdog/vmpooler/labels{/name}","releases_url":"https://api.github.com/repos/shermdog/vmpooler/releases{/id}","deployments_url":"https://api.github.com/repos/shermdog/vmpooler/deployments","created_at":"2016-01-12T20:38:21Z","updated_at":"2016-01-12T20:38:21Z","pushed_at":"2016-06-08T04:03:20Z","git_url":"git://github.com/shermdog/vmpooler.git","ssh_url":"git@github.com:shermdog/vmpooler.git","clone_url":"https://github.com/shermdog/vmpooler.git","svn_url":"https://github.com/shermdog/vmpooler","homepage":"","size":1021,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"puppetlabs:ci.next","ref":"ci.next","sha":"5aaab7c5c2e433959578530060a5c529bda60ebf","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":13072980,"name":"vmpooler","full_name":"puppetlabs/vmpooler","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/vmpooler","description":"Provide configurable 'pools' of instantly-available (running) virtual machines","fork":false,"url":"https://api.github.com/repos/puppetlabs/vmpooler","forks_url":"https://api.github.com/repos/puppetlabs/vmpooler/forks","keys_url":"https://api.github.com/repos/puppetlabs/vmpooler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/vmpooler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/vmpooler/teams","hooks_url":"https://api.github.com/repos/puppetlabs/vmpooler/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/vmpooler/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/vmpooler/events","assignees_url":"https://api.github.com/repos/puppetlabs/vmpooler/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/vmpooler/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/vmpooler/tags","blobs_url":"https://api.github.com/repos/puppetlabs/vmpooler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/vmpooler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/vmpooler/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/vmpooler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/vmpooler/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/vmpooler/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/vmpooler/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/vmpooler/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/vmpooler/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/vmpooler/subscription","commits_url":"https://api.github.com/repos/puppetlabs/vmpooler/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/vmpooler/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/vmpooler/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/vmpooler/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/vmpooler/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/vmpooler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/vmpooler/merges","archive_url":"https://api.github.com/repos/puppetlabs/vmpooler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/vmpooler/downloads","issues_url":"https://api.github.com/repos/puppetlabs/vmpooler/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/vmpooler/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/vmpooler/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/vmpooler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/vmpooler/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/vmpooler/releases{/id}","deployments_url":"https://api.github.com/repos/puppetlabs/vmpooler/deployments","created_at":"2013-09-24T18:27:35Z","updated_at":"2016-05-13T19:18:02Z","pushed_at":"2016-06-08T04:05:31Z","git_url":"git://github.com/puppetlabs/vmpooler.git","ssh_url":"git@github.com:puppetlabs/vmpooler.git","clone_url":"https://github.com/puppetlabs/vmpooler.git","svn_url":"https://github.com/puppetlabs/vmpooler","homepage":"","size":1431,"stargazers_count":48,"watchers_count":48,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":20,"mirror_url":null,"open_issues_count":13,"forks":20,"open_issues":13,"watchers":48,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/vmpooler/pulls/155"},"html":{"href":"https://github.com/puppetlabs/vmpooler/pull/155"},"issue":{"href":"https://api.github.com/repos/puppetlabs/vmpooler/issues/155"},"comments":{"href":"https://api.github.com/repos/puppetlabs/vmpooler/issues/155/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/vmpooler/pulls/155/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/vmpooler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/vmpooler/pulls/155/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/vmpooler/statuses/b9834720883283e4031e617b11be2ac5300839d2"}}}}
{"actor":{"display_login":"mckern"}}