{"action":"created","comment":{"url":"https://api.github.com/repos/hawkular/hawkular-apm/pulls/comments/71657368","id":71657368,"diff_hunk":"@@ -282,6 +282,57 @@ public long getTraceCompletionFaultCount(String tenantId, Criteria criteria) {\n     }\n \n     /* (non-Javadoc)\n+     * @see org.hawkular.apm.api.services.AnalyticsService#getTraceCompletionTimes(java.lang.String, org.hawkular.apm.api.services.Criteria)\n+     */\n+    @Override\n+    public List<CompletionTime> getTraceCompletionTimes(String tenantId, Criteria criteria) {\n+        String index = client.getIndex(tenantId);\n+\n+        try {\n+            RefreshRequestBuilder refreshRequestBuilder =\n+                    client.getClient().admin().indices().prepareRefresh(index);\n+            client.getClient().admin().indices().refresh(refreshRequestBuilder.request()).actionGet();\n+\n+            BoolQueryBuilder query = ElasticsearchUtil.buildQuery(criteria, \"timestamp\", \"businessTransaction\");\n+\n+            SearchRequestBuilder request = client.getClient().prepareSearch(index)\n+                    .setTypes(TRACE_COMPLETION_TIME_TYPE)\n+                    .setSearchType(SearchType.DFS_QUERY_THEN_FETCH)\n+                    .setTimeout(TimeValue.timeValueMillis(criteria.getTimeout()))\n+                    .setSize(criteria.getMaxResponseSize())\n+                    .setQuery(query);\n+\n+            SearchResponse response = request.execute().actionGet();\n+            if (response.isTimedOut()) {\n+                msgLog.warnQueryTimedOut();\n+                return null;\n+            }\n+\n+            List<CompletionTime> ret = new ArrayList<CompletionTime>();\n+\n+            for (SearchHit searchHitFields : response.getHits()) {\n+                try {\n+                    ret.add(mapper.readValue(searchHitFields.getSourceAsString(),\n+                            CompletionTime.class));\n+                } catch (Exception e) {","path":"server/elasticsearch/src/main/java/org/hawkular/apm/server/elasticsearch/AnalyticsServiceElasticsearch.java","position":36,"original_position":36,"commit_id":"2b3c0177917dc870ccac8d728a629a200fb246d6","original_commit_id":"2b3c0177917dc870ccac8d728a629a200fb246d6","user":{"login":"objectiser","id":164562,"avatar_url":"https://avatars.githubusercontent.com/u/164562?v=3","gravatar_id":"","url":"https://api.github.com/users/objectiser","html_url":"https://github.com/objectiser","followers_url":"https://api.github.com/users/objectiser/followers","following_url":"https://api.github.com/users/objectiser/following{/other_user}","gists_url":"https://api.github.com/users/objectiser/gists{/gist_id}","starred_url":"https://api.github.com/users/objectiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/objectiser/subscriptions","organizations_url":"https://api.github.com/users/objectiser/orgs","repos_url":"https://api.github.com/users/objectiser/repos","events_url":"https://api.github.com/users/objectiser/events{/privacy}","received_events_url":"https://api.github.com/users/objectiser/received_events","type":"User","site_admin":false},"body":"Guilty :) its just me being lazy - I'll fix.","created_at":"2016-07-21T07:18:16Z","updated_at":"2016-07-21T07:18:16Z","html_url":"https://github.com/hawkular/hawkular-apm/pull/483#discussion_r71657368","pull_request_url":"https://api.github.com/repos/hawkular/hawkular-apm/pulls/483","_links":{"self":{"href":"https://api.github.com/repos/hawkular/hawkular-apm/pulls/comments/71657368"},"html":{"href":"https://github.com/hawkular/hawkular-apm/pull/483#discussion_r71657368"},"pull_request":{"href":"https://api.github.com/repos/hawkular/hawkular-apm/pulls/483"}}},"pull_request":{"url":"https://api.github.com/repos/hawkular/hawkular-apm/pulls/483","id":78128268,"html_url":"https://github.com/hawkular/hawkular-apm/pull/483","diff_url":"https://github.com/hawkular/hawkular-apm/pull/483.diff","patch_url":"https://github.com/hawkular/hawkular-apm/pull/483.patch","issue_url":"https://api.github.com/repos/hawkular/hawkular-apm/issues/483","number":483,"state":"open","locked":false,"title":"HWKAPM-539 REST endpoint for retrieving trace completion times","user":{"login":"objectiser","id":164562,"avatar_url":"https://avatars.githubusercontent.com/u/164562?v=3","gravatar_id":"","url":"https://api.github.com/users/objectiser","html_url":"https://github.com/objectiser","followers_url":"https://api.github.com/users/objectiser/followers","following_url":"https://api.github.com/users/objectiser/following{/other_user}","gists_url":"https://api.github.com/users/objectiser/gists{/gist_id}","starred_url":"https://api.github.com/users/objectiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/objectiser/subscriptions","organizations_url":"https://api.github.com/users/objectiser/orgs","repos_url":"https://api.github.com/users/objectiser/repos","events_url":"https://api.github.com/users/objectiser/events{/privacy}","received_events_url":"https://api.github.com/users/objectiser/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-20T11:08:14Z","updated_at":"2016-07-21T07:18:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f74a60627b1b61c024346e9649b206c20b97d8f2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hawkular/hawkular-apm/pulls/483/commits","review_comments_url":"https://api.github.com/repos/hawkular/hawkular-apm/pulls/483/comments","review_comment_url":"https://api.github.com/repos/hawkular/hawkular-apm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hawkular/hawkular-apm/issues/483/comments","statuses_url":"https://api.github.com/repos/hawkular/hawkular-apm/statuses/2b3c0177917dc870ccac8d728a629a200fb246d6","head":{"label":"objectiser:HWKAPM-539","ref":"HWKAPM-539","sha":"2b3c0177917dc870ccac8d728a629a200fb246d6","user":{"login":"objectiser","id":164562,"avatar_url":"https://avatars.githubusercontent.com/u/164562?v=3","gravatar_id":"","url":"https://api.github.com/users/objectiser","html_url":"https://github.com/objectiser","followers_url":"https://api.github.com/users/objectiser/followers","following_url":"https://api.github.com/users/objectiser/following{/other_user}","gists_url":"https://api.github.com/users/objectiser/gists{/gist_id}","starred_url":"https://api.github.com/users/objectiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/objectiser/subscriptions","organizations_url":"https://api.github.com/users/objectiser/orgs","repos_url":"https://api.github.com/users/objectiser/repos","events_url":"https://api.github.com/users/objectiser/events{/privacy}","received_events_url":"https://api.github.com/users/objectiser/received_events","type":"User","site_admin":false},"repo":{"id":34446762,"name":"hawkular-apm","full_name":"objectiser/hawkular-apm","owner":{"login":"objectiser","id":164562,"avatar_url":"https://avatars.githubusercontent.com/u/164562?v=3","gravatar_id":"","url":"https://api.github.com/users/objectiser","html_url":"https://github.com/objectiser","followers_url":"https://api.github.com/users/objectiser/followers","following_url":"https://api.github.com/users/objectiser/following{/other_user}","gists_url":"https://api.github.com/users/objectiser/gists{/gist_id}","starred_url":"https://api.github.com/users/objectiser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/objectiser/subscriptions","organizations_url":"https://api.github.com/users/objectiser/orgs","repos_url":"https://api.github.com/users/objectiser/repos","events_url":"https://api.github.com/users/objectiser/events{/privacy}","received_events_url":"https://api.github.com/users/objectiser/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/objectiser/hawkular-apm","description":"Application Performance Management for Hawkular","fork":true,"url":"https://api.github.com/repos/objectiser/hawkular-apm","forks_url":"https://api.github.com/repos/objectiser/hawkular-apm/forks","keys_url":"https://api.github.com/repos/objectiser/hawkular-apm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/objectiser/hawkular-apm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/objectiser/hawkular-apm/teams","hooks_url":"https://api.github.com/repos/objectiser/hawkular-apm/hooks","issue_events_url":"https://api.github.com/repos/objectiser/hawkular-apm/issues/events{/number}","events_url":"https://api.github.com/repos/objectiser/hawkular-apm/events","assignees_url":"https://api.github.com/repos/objectiser/hawkular-apm/assignees{/user}","branches_url":"https://api.github.com/repos/objectiser/hawkular-apm/branches{/branch}","tags_url":"https://api.github.com/repos/objectiser/hawkular-apm/tags","blobs_url":"https://api.github.com/repos/objectiser/hawkular-apm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/objectiser/hawkular-apm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/objectiser/hawkular-apm/git/refs{/sha}","trees_url":"https://api.github.com/repos/objectiser/hawkular-apm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/objectiser/hawkular-apm/statuses/{sha}","languages_url":"https://api.github.com/repos/objectiser/hawkular-apm/languages","stargazers_url":"https://api.github.com/repos/objectiser/hawkular-apm/stargazers","contributors_url":"https://api.github.com/repos/objectiser/hawkular-apm/contributors","subscribers_url":"https://api.github.com/repos/objectiser/hawkular-apm/subscribers","subscription_url":"https://api.github.com/repos/objectiser/hawkular-apm/subscription","commits_url":"https://api.github.com/repos/objectiser/hawkular-apm/commits{/sha}","git_commits_url":"https://api.github.com/repos/objectiser/hawkular-apm/git/commits{/sha}","comments_url":"https://api.github.com/repos/objectiser/hawkular-apm/comments{/number}","issue_comment_url":"https://api.github.com/repos/objectiser/hawkular-apm/issues/comments{/number}","contents_url":"https://api.github.com/repos/objectiser/hawkular-apm/contents/{+path}","compare_url":"https://api.github.com/repos/objectiser/hawkular-apm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/objectiser/hawkular-apm/merges","archive_url":"https://api.github.com/repos/objectiser/hawkular-apm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/objectiser/hawkular-apm/downloads","issues_url":"https://api.github.com/repos/objectiser/hawkular-apm/issues{/number}","pulls_url":"https://api.github.com/repos/objectiser/hawkular-apm/pulls{/number}","milestones_url":"https://api.github.com/repos/objectiser/hawkular-apm/milestones{/number}","notifications_url":"https://api.github.com/repos/objectiser/hawkular-apm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/objectiser/hawkular-apm/labels{/name}","releases_url":"https://api.github.com/repos/objectiser/hawkular-apm/releases{/id}","deployments_url":"https://api.github.com/repos/objectiser/hawkular-apm/deployments","created_at":"2015-04-23T09:26:55Z","updated_at":"2016-06-03T10:47:39Z","pushed_at":"2016-07-20T16:02:10Z","git_url":"git://github.com/objectiser/hawkular-apm.git","ssh_url":"git@github.com:objectiser/hawkular-apm.git","clone_url":"https://github.com/objectiser/hawkular-apm.git","svn_url":"https://github.com/objectiser/hawkular-apm","homepage":"","size":5481,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"hawkular:master","ref":"master","sha":"de1c8a299ae4e9e13cfcb8355204ec125a5778a9","user":{"login":"hawkular","id":10179627,"avatar_url":"https://avatars.githubusercontent.com/u/10179627?v=3","gravatar_id":"","url":"https://api.github.com/users/hawkular","html_url":"https://github.com/hawkular","followers_url":"https://api.github.com/users/hawkular/followers","following_url":"https://api.github.com/users/hawkular/following{/other_user}","gists_url":"https://api.github.com/users/hawkular/gists{/gist_id}","starred_url":"https://api.github.com/users/hawkular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hawkular/subscriptions","organizations_url":"https://api.github.com/users/hawkular/orgs","repos_url":"https://api.github.com/users/hawkular/repos","events_url":"https://api.github.com/users/hawkular/events{/privacy}","received_events_url":"https://api.github.com/users/hawkular/received_events","type":"Organization","site_admin":false},"repo":{"id":34446334,"name":"hawkular-apm","full_name":"hawkular/hawkular-apm","owner":{"login":"hawkular","id":10179627,"avatar_url":"https://avatars.githubusercontent.com/u/10179627?v=3","gravatar_id":"","url":"https://api.github.com/users/hawkular","html_url":"https://github.com/hawkular","followers_url":"https://api.github.com/users/hawkular/followers","following_url":"https://api.github.com/users/hawkular/following{/other_user}","gists_url":"https://api.github.com/users/hawkular/gists{/gist_id}","starred_url":"https://api.github.com/users/hawkular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hawkular/subscriptions","organizations_url":"https://api.github.com/users/hawkular/orgs","repos_url":"https://api.github.com/users/hawkular/repos","events_url":"https://api.github.com/users/hawkular/events{/privacy}","received_events_url":"https://api.github.com/users/hawkular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hawkular/hawkular-apm","description":"Application Performance Management for Hawkular","fork":false,"url":"https://api.github.com/repos/hawkular/hawkular-apm","forks_url":"https://api.github.com/repos/hawkular/hawkular-apm/forks","keys_url":"https://api.github.com/repos/hawkular/hawkular-apm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hawkular/hawkular-apm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hawkular/hawkular-apm/teams","hooks_url":"https://api.github.com/repos/hawkular/hawkular-apm/hooks","issue_events_url":"https://api.github.com/repos/hawkular/hawkular-apm/issues/events{/number}","events_url":"https://api.github.com/repos/hawkular/hawkular-apm/events","assignees_url":"https://api.github.com/repos/hawkular/hawkular-apm/assignees{/user}","branches_url":"https://api.github.com/repos/hawkular/hawkular-apm/branches{/branch}","tags_url":"https://api.github.com/repos/hawkular/hawkular-apm/tags","blobs_url":"https://api.github.com/repos/hawkular/hawkular-apm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hawkular/hawkular-apm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hawkular/hawkular-apm/git/refs{/sha}","trees_url":"https://api.github.com/repos/hawkular/hawkular-apm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hawkular/hawkular-apm/statuses/{sha}","languages_url":"https://api.github.com/repos/hawkular/hawkular-apm/languages","stargazers_url":"https://api.github.com/repos/hawkular/hawkular-apm/stargazers","contributors_url":"https://api.github.com/repos/hawkular/hawkular-apm/contributors","subscribers_url":"https://api.github.com/repos/hawkular/hawkular-apm/subscribers","subscription_url":"https://api.github.com/repos/hawkular/hawkular-apm/subscription","commits_url":"https://api.github.com/repos/hawkular/hawkular-apm/commits{/sha}","git_commits_url":"https://api.github.com/repos/hawkular/hawkular-apm/git/commits{/sha}","comments_url":"https://api.github.com/repos/hawkular/hawkular-apm/comments{/number}","issue_comment_url":"https://api.github.com/repos/hawkular/hawkular-apm/issues/comments{/number}","contents_url":"https://api.github.com/repos/hawkular/hawkular-apm/contents/{+path}","compare_url":"https://api.github.com/repos/hawkular/hawkular-apm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hawkular/hawkular-apm/merges","archive_url":"https://api.github.com/repos/hawkular/hawkular-apm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hawkular/hawkular-apm/downloads","issues_url":"https://api.github.com/repos/hawkular/hawkular-apm/issues{/number}","pulls_url":"https://api.github.com/repos/hawkular/hawkular-apm/pulls{/number}","milestones_url":"https://api.github.com/repos/hawkular/hawkular-apm/milestones{/number}","notifications_url":"https://api.github.com/repos/hawkular/hawkular-apm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hawkular/hawkular-apm/labels{/name}","releases_url":"https://api.github.com/repos/hawkular/hawkular-apm/releases{/id}","deployments_url":"https://api.github.com/repos/hawkular/hawkular-apm/deployments","created_at":"2015-04-23T09:17:50Z","updated_at":"2016-07-05T13:30:09Z","pushed_at":"2016-07-20T16:04:43Z","git_url":"git://github.com/hawkular/hawkular-apm.git","ssh_url":"git@github.com:hawkular/hawkular-apm.git","clone_url":"https://github.com/hawkular/hawkular-apm.git","svn_url":"https://github.com/hawkular/hawkular-apm","homepage":"","size":5489,"stargazers_count":10,"watchers_count":10,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":2,"forks":12,"open_issues":2,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hawkular/hawkular-apm/pulls/483"},"html":{"href":"https://github.com/hawkular/hawkular-apm/pull/483"},"issue":{"href":"https://api.github.com/repos/hawkular/hawkular-apm/issues/483"},"comments":{"href":"https://api.github.com/repos/hawkular/hawkular-apm/issues/483/comments"},"review_comments":{"href":"https://api.github.com/repos/hawkular/hawkular-apm/pulls/483/comments"},"review_comment":{"href":"https://api.github.com/repos/hawkular/hawkular-apm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hawkular/hawkular-apm/pulls/483/commits"},"statuses":{"href":"https://api.github.com/repos/hawkular/hawkular-apm/statuses/2b3c0177917dc870ccac8d728a629a200fb246d6"}}}}
{"actor":{"display_login":"objectiser"}}