{"action":"created","comment":{"url":"https://api.github.com/repos/os-autoinst/openQA/pulls/comments/54399269","id":54399269,"diff_hunk":"@@ -81,7 +87,7 @@ sub _group_result {\n                     || $job->result eq OpenQA::Schema::Result::Jobs::INCOMPLETE)\n                 {\n                     $jr{failed}++;\n-                    $jr{labeled}++ if $job->comments > 0;\n+                    $jr{labeled}++ if ($labels{$job->id} && $labels{$job->id} > 0);","path":"lib/OpenQA/WebAPI/Controller/Main.pm","position":18,"original_position":18,"commit_id":"9c21f0fe7bb264dacf18422f6fbf13536703463b","original_commit_id":"9c21f0fe7bb264dacf18422f6fbf13536703463b","user":{"login":"coolo","id":1067203,"avatar_url":"https://avatars.githubusercontent.com/u/1067203?v=3","gravatar_id":"","url":"https://api.github.com/users/coolo","html_url":"https://github.com/coolo","followers_url":"https://api.github.com/users/coolo/followers","following_url":"https://api.github.com/users/coolo/following{/other_user}","gists_url":"https://api.github.com/users/coolo/gists{/gist_id}","starred_url":"https://api.github.com/users/coolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coolo/subscriptions","organizations_url":"https://api.github.com/users/coolo/orgs","repos_url":"https://api.github.com/users/coolo/repos","events_url":"https://api.github.com/users/coolo/events{/privacy}","received_events_url":"https://api.github.com/users/coolo/received_events","type":"User","site_admin":false},"body":"you still don't trust perl's if? It can't get < 0","created_at":"2016-02-29T11:42:57Z","updated_at":"2016-02-29T11:42:57Z","html_url":"https://github.com/os-autoinst/openQA/pull/581#discussion_r54399269","pull_request_url":"https://api.github.com/repos/os-autoinst/openQA/pulls/581","_links":{"self":{"href":"https://api.github.com/repos/os-autoinst/openQA/pulls/comments/54399269"},"html":{"href":"https://github.com/os-autoinst/openQA/pull/581#discussion_r54399269"},"pull_request":{"href":"https://api.github.com/repos/os-autoinst/openQA/pulls/581"}}},"pull_request":{"url":"https://api.github.com/repos/os-autoinst/openQA/pulls/581","id":60901674,"html_url":"https://github.com/os-autoinst/openQA/pull/581","diff_url":"https://github.com/os-autoinst/openQA/pull/581.diff","patch_url":"https://github.com/os-autoinst/openQA/pull/581.patch","issue_url":"https://api.github.com/repos/os-autoinst/openQA/issues/581","number":581,"state":"open","locked":false,"title":"[WIP] Optimize comment lookup for group_result by prefetch","user":{"login":"okurz","id":1693432,"avatar_url":"https://avatars.githubusercontent.com/u/1693432?v=3","gravatar_id":"","url":"https://api.github.com/users/okurz","html_url":"https://github.com/okurz","followers_url":"https://api.github.com/users/okurz/followers","following_url":"https://api.github.com/users/okurz/following{/other_user}","gists_url":"https://api.github.com/users/okurz/gists{/gist_id}","starred_url":"https://api.github.com/users/okurz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okurz/subscriptions","organizations_url":"https://api.github.com/users/okurz/orgs","repos_url":"https://api.github.com/users/okurz/repos","events_url":"https://api.github.com/users/okurz/events{/privacy}","received_events_url":"https://api.github.com/users/okurz/received_events","type":"User","site_admin":false},"body":"Same functionality as in before but faster as comments are prefetched for all\r\njobs in each build in each group. Obviously this could be further optimized\r\nby prefetching comments for all jobs at once but we do not know the jobs\r\nbefore iterating the builds.\r\n\r\nTested with a production database dump from openqa.suse.de from\r\n2016-02-25 fetching the page 'group_overview/25'. Comparing the number of\r\nqueries for comments and the user space time.\r\n\r\nBefore: 356 @ 2.6s\r\nAfter: 11 @ 1.9s\r\n\r\n*WIP*: It looks like the database from o.s.d is much more demanding and should be used for testing. But the current state of the database seems to have yet another problem so I am not sure against which database dump I should test.","created_at":"2016-02-26T20:47:41Z","updated_at":"2016-02-29T11:42:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea4909f8fa0a2a526a95b2d738e3309f56aeb157","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/os-autoinst/openQA/pulls/581/commits","review_comments_url":"https://api.github.com/repos/os-autoinst/openQA/pulls/581/comments","review_comment_url":"https://api.github.com/repos/os-autoinst/openQA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/os-autoinst/openQA/issues/581/comments","statuses_url":"https://api.github.com/repos/os-autoinst/openQA/statuses/9c21f0fe7bb264dacf18422f6fbf13536703463b","head":{"label":"okurz:enhance/comments_queries","ref":"enhance/comments_queries","sha":"9c21f0fe7bb264dacf18422f6fbf13536703463b","user":{"login":"okurz","id":1693432,"avatar_url":"https://avatars.githubusercontent.com/u/1693432?v=3","gravatar_id":"","url":"https://api.github.com/users/okurz","html_url":"https://github.com/okurz","followers_url":"https://api.github.com/users/okurz/followers","following_url":"https://api.github.com/users/okurz/following{/other_user}","gists_url":"https://api.github.com/users/okurz/gists{/gist_id}","starred_url":"https://api.github.com/users/okurz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okurz/subscriptions","organizations_url":"https://api.github.com/users/okurz/orgs","repos_url":"https://api.github.com/users/okurz/repos","events_url":"https://api.github.com/users/okurz/events{/privacy}","received_events_url":"https://api.github.com/users/okurz/received_events","type":"User","site_admin":false},"repo":{"id":46416941,"name":"openQA","full_name":"okurz/openQA","owner":{"login":"okurz","id":1693432,"avatar_url":"https://avatars.githubusercontent.com/u/1693432?v=3","gravatar_id":"","url":"https://api.github.com/users/okurz","html_url":"https://github.com/okurz","followers_url":"https://api.github.com/users/okurz/followers","following_url":"https://api.github.com/users/okurz/following{/other_user}","gists_url":"https://api.github.com/users/okurz/gists{/gist_id}","starred_url":"https://api.github.com/users/okurz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okurz/subscriptions","organizations_url":"https://api.github.com/users/okurz/orgs","repos_url":"https://api.github.com/users/okurz/repos","events_url":"https://api.github.com/users/okurz/events{/privacy}","received_events_url":"https://api.github.com/users/okurz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/okurz/openQA","description":"openQA web-frontend, scheduler and tools","fork":true,"url":"https://api.github.com/repos/okurz/openQA","forks_url":"https://api.github.com/repos/okurz/openQA/forks","keys_url":"https://api.github.com/repos/okurz/openQA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/okurz/openQA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/okurz/openQA/teams","hooks_url":"https://api.github.com/repos/okurz/openQA/hooks","issue_events_url":"https://api.github.com/repos/okurz/openQA/issues/events{/number}","events_url":"https://api.github.com/repos/okurz/openQA/events","assignees_url":"https://api.github.com/repos/okurz/openQA/assignees{/user}","branches_url":"https://api.github.com/repos/okurz/openQA/branches{/branch}","tags_url":"https://api.github.com/repos/okurz/openQA/tags","blobs_url":"https://api.github.com/repos/okurz/openQA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/okurz/openQA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/okurz/openQA/git/refs{/sha}","trees_url":"https://api.github.com/repos/okurz/openQA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/okurz/openQA/statuses/{sha}","languages_url":"https://api.github.com/repos/okurz/openQA/languages","stargazers_url":"https://api.github.com/repos/okurz/openQA/stargazers","contributors_url":"https://api.github.com/repos/okurz/openQA/contributors","subscribers_url":"https://api.github.com/repos/okurz/openQA/subscribers","subscription_url":"https://api.github.com/repos/okurz/openQA/subscription","commits_url":"https://api.github.com/repos/okurz/openQA/commits{/sha}","git_commits_url":"https://api.github.com/repos/okurz/openQA/git/commits{/sha}","comments_url":"https://api.github.com/repos/okurz/openQA/comments{/number}","issue_comment_url":"https://api.github.com/repos/okurz/openQA/issues/comments{/number}","contents_url":"https://api.github.com/repos/okurz/openQA/contents/{+path}","compare_url":"https://api.github.com/repos/okurz/openQA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/okurz/openQA/merges","archive_url":"https://api.github.com/repos/okurz/openQA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/okurz/openQA/downloads","issues_url":"https://api.github.com/repos/okurz/openQA/issues{/number}","pulls_url":"https://api.github.com/repos/okurz/openQA/pulls{/number}","milestones_url":"https://api.github.com/repos/okurz/openQA/milestones{/number}","notifications_url":"https://api.github.com/repos/okurz/openQA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/okurz/openQA/labels{/name}","releases_url":"https://api.github.com/repos/okurz/openQA/releases{/id}","deployments_url":"https://api.github.com/repos/okurz/openQA/deployments","created_at":"2015-11-18T12:21:59Z","updated_at":"2016-02-02T08:06:30Z","pushed_at":"2016-02-28T11:34:31Z","git_url":"git://github.com/okurz/openQA.git","ssh_url":"git@github.com:okurz/openQA.git","clone_url":"https://github.com/okurz/openQA.git","svn_url":"https://github.com/okurz/openQA","homepage":"http://openqa.opensuse.org/","size":14277,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"os-autoinst:master","ref":"master","sha":"6a627b405ec9500a1f23d13786afd80732fa15f3","user":{"login":"os-autoinst","id":6918706,"avatar_url":"https://avatars.githubusercontent.com/u/6918706?v=3","gravatar_id":"","url":"https://api.github.com/users/os-autoinst","html_url":"https://github.com/os-autoinst","followers_url":"https://api.github.com/users/os-autoinst/followers","following_url":"https://api.github.com/users/os-autoinst/following{/other_user}","gists_url":"https://api.github.com/users/os-autoinst/gists{/gist_id}","starred_url":"https://api.github.com/users/os-autoinst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/os-autoinst/subscriptions","organizations_url":"https://api.github.com/users/os-autoinst/orgs","repos_url":"https://api.github.com/users/os-autoinst/repos","events_url":"https://api.github.com/users/os-autoinst/events{/privacy}","received_events_url":"https://api.github.com/users/os-autoinst/received_events","type":"Organization","site_admin":false},"repo":{"id":20883829,"name":"openQA","full_name":"os-autoinst/openQA","owner":{"login":"os-autoinst","id":6918706,"avatar_url":"https://avatars.githubusercontent.com/u/6918706?v=3","gravatar_id":"","url":"https://api.github.com/users/os-autoinst","html_url":"https://github.com/os-autoinst","followers_url":"https://api.github.com/users/os-autoinst/followers","following_url":"https://api.github.com/users/os-autoinst/following{/other_user}","gists_url":"https://api.github.com/users/os-autoinst/gists{/gist_id}","starred_url":"https://api.github.com/users/os-autoinst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/os-autoinst/subscriptions","organizations_url":"https://api.github.com/users/os-autoinst/orgs","repos_url":"https://api.github.com/users/os-autoinst/repos","events_url":"https://api.github.com/users/os-autoinst/events{/privacy}","received_events_url":"https://api.github.com/users/os-autoinst/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/os-autoinst/openQA","description":"openQA web-frontend, scheduler and tools","fork":false,"url":"https://api.github.com/repos/os-autoinst/openQA","forks_url":"https://api.github.com/repos/os-autoinst/openQA/forks","keys_url":"https://api.github.com/repos/os-autoinst/openQA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/os-autoinst/openQA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/os-autoinst/openQA/teams","hooks_url":"https://api.github.com/repos/os-autoinst/openQA/hooks","issue_events_url":"https://api.github.com/repos/os-autoinst/openQA/issues/events{/number}","events_url":"https://api.github.com/repos/os-autoinst/openQA/events","assignees_url":"https://api.github.com/repos/os-autoinst/openQA/assignees{/user}","branches_url":"https://api.github.com/repos/os-autoinst/openQA/branches{/branch}","tags_url":"https://api.github.com/repos/os-autoinst/openQA/tags","blobs_url":"https://api.github.com/repos/os-autoinst/openQA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/os-autoinst/openQA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/os-autoinst/openQA/git/refs{/sha}","trees_url":"https://api.github.com/repos/os-autoinst/openQA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/os-autoinst/openQA/statuses/{sha}","languages_url":"https://api.github.com/repos/os-autoinst/openQA/languages","stargazers_url":"https://api.github.com/repos/os-autoinst/openQA/stargazers","contributors_url":"https://api.github.com/repos/os-autoinst/openQA/contributors","subscribers_url":"https://api.github.com/repos/os-autoinst/openQA/subscribers","subscription_url":"https://api.github.com/repos/os-autoinst/openQA/subscription","commits_url":"https://api.github.com/repos/os-autoinst/openQA/commits{/sha}","git_commits_url":"https://api.github.com/repos/os-autoinst/openQA/git/commits{/sha}","comments_url":"https://api.github.com/repos/os-autoinst/openQA/comments{/number}","issue_comment_url":"https://api.github.com/repos/os-autoinst/openQA/issues/comments{/number}","contents_url":"https://api.github.com/repos/os-autoinst/openQA/contents/{+path}","compare_url":"https://api.github.com/repos/os-autoinst/openQA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/os-autoinst/openQA/merges","archive_url":"https://api.github.com/repos/os-autoinst/openQA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/os-autoinst/openQA/downloads","issues_url":"https://api.github.com/repos/os-autoinst/openQA/issues{/number}","pulls_url":"https://api.github.com/repos/os-autoinst/openQA/pulls{/number}","milestones_url":"https://api.github.com/repos/os-autoinst/openQA/milestones{/number}","notifications_url":"https://api.github.com/repos/os-autoinst/openQA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/os-autoinst/openQA/labels{/name}","releases_url":"https://api.github.com/repos/os-autoinst/openQA/releases{/id}","deployments_url":"https://api.github.com/repos/os-autoinst/openQA/deployments","created_at":"2014-06-16T12:23:22Z","updated_at":"2016-02-22T07:10:40Z","pushed_at":"2016-02-29T11:39:18Z","git_url":"git://github.com/os-autoinst/openQA.git","ssh_url":"git@github.com:os-autoinst/openQA.git","clone_url":"https://github.com/os-autoinst/openQA.git","svn_url":"https://github.com/os-autoinst/openQA","homepage":"http://openqa.opensuse.org/","size":15454,"stargazers_count":43,"watchers_count":43,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":40,"mirror_url":null,"open_issues_count":16,"forks":40,"open_issues":16,"watchers":43,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/os-autoinst/openQA/pulls/581"},"html":{"href":"https://github.com/os-autoinst/openQA/pull/581"},"issue":{"href":"https://api.github.com/repos/os-autoinst/openQA/issues/581"},"comments":{"href":"https://api.github.com/repos/os-autoinst/openQA/issues/581/comments"},"review_comments":{"href":"https://api.github.com/repos/os-autoinst/openQA/pulls/581/comments"},"review_comment":{"href":"https://api.github.com/repos/os-autoinst/openQA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/os-autoinst/openQA/pulls/581/commits"},"statuses":{"href":"https://api.github.com/repos/os-autoinst/openQA/statuses/9c21f0fe7bb264dacf18422f6fbf13536703463b"}}}}