{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/5416","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/5416/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/5416/comments","events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/5416/events","html_url":"https://github.com/ManageIQ/manageiq/pull/5416","id":116625652,"number":5416,"title":"Don't count begin/commit in query counts","user":{"login":"kbrock","id":1930,"avatar_url":"https://avatars.githubusercontent.com/u/1930?v=3","gravatar_id":"","url":"https://api.github.com/users/kbrock","html_url":"https://github.com/kbrock","followers_url":"https://api.github.com/users/kbrock/followers","following_url":"https://api.github.com/users/kbrock/following{/other_user}","gists_url":"https://api.github.com/users/kbrock/gists{/gist_id}","starred_url":"https://api.github.com/users/kbrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbrock/subscriptions","organizations_url":"https://api.github.com/users/kbrock/orgs","repos_url":"https://api.github.com/users/kbrock/repos","events_url":"https://api.github.com/users/kbrock/events{/privacy}","received_events_url":"https://api.github.com/users/kbrock/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/test","name":"test","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-11-12T19:45:40Z","updated_at":"2015-12-02T00:03:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/5416","html_url":"https://github.com/ManageIQ/manageiq/pull/5416","diff_url":"https://github.com/ManageIQ/manageiq/pull/5416.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/5416.patch"},"body":"Fix the number of queries reported\r\n\r\nBefore:\r\nThe count included `BEGIN` and `END` transactions. So it reported that 5 queries ran.\r\n\r\nAfter:\r\nThe count ignores unnamed queries, so it reports that 3 queries ran.\r\n\r\n---\r\n\r\n```ruby\r\nrequire \"./spec/support/query_counter\"\r\n# Zone.where(:name => \"zone1\").destroy_all\r\nputs QueryCounter.count { Zone.create(:name => \"zone1\", :description => \"throw away\") }\r\n```\r\n\r\n|name|SQL|\r\n---|---\r\n||`BEGIN`|\r\n|Zone Exists|`SELECT  1 AS one FROM \"zones\" WHERE`|\r\n|SQL|`INSERT INTO \"zones\" (\"name\", \"description\", \"created_on\", \"updated_on\")`|\r\n|MiqServer Load|`SELECT \"miq_servers\".* FROM \"miq_servers\" WHERE`|\r\n||`Commit`|\r\n\r\n/cc @Fryguy \r\n"},"comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments/161136920","html_url":"https://github.com/ManageIQ/manageiq/pull/5416#issuecomment-161136920","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/5416","id":161136920,"user":{"login":"Fryguy","id":52120,"avatar_url":"https://avatars.githubusercontent.com/u/52120?v=3","gravatar_id":"","url":"https://api.github.com/users/Fryguy","html_url":"https://github.com/Fryguy","followers_url":"https://api.github.com/users/Fryguy/followers","following_url":"https://api.github.com/users/Fryguy/following{/other_user}","gists_url":"https://api.github.com/users/Fryguy/gists{/gist_id}","starred_url":"https://api.github.com/users/Fryguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fryguy/subscriptions","organizations_url":"https://api.github.com/users/Fryguy/orgs","repos_url":"https://api.github.com/users/Fryguy/repos","events_url":"https://api.github.com/users/Fryguy/events{/privacy}","received_events_url":"https://api.github.com/users/Fryguy/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T00:03:25Z","updated_at":"2015-12-02T00:03:25Z","body":"The spec is interesting in that it tests a spec/support file.  So the file under test is `spec/support/query_counter.rb`, but the spec was placed in `spec/lib/query_counter_spec.rb`, which doesn't match.  I admit that I don't have a better place to put it though.  cc @jrafanie @matthewd Thoughts?"}}