{"action":"created","comment":{"url":"https://api.github.com/repos/caskdata/cdap/pulls/comments/37561155","id":37561155,"diff_hunk":"@@ -89,4 +108,131 @@ public void workflowStats(HttpRequest request, HttpResponder responder,\n     }\n     responder.sendJson(HttpResponseStatus.OK, workflowStatistics);\n   }\n+\n+  @GET\n+  @Path(\"apps/{app-id}/workflows/{workflow-id}/runs/{run-id}/statistics\")\n+  public void workflowRunDetail(HttpRequest request, HttpResponder responder,\n+                                @PathParam(\"namespace-id\") String namespaceId,\n+                                @PathParam(\"app-id\") String appId,\n+                                @PathParam(\"workflow-id\") String workflowId,\n+                                @PathParam(\"run-id\") String runId,\n+                                @QueryParam(\"count\") int count,\n+                                @QueryParam(\"interval\") String interval) throws Exception {\n+    long timeInterval = TimeMathParser.resolutionInSeconds(interval);\n+    Id.Workflow workflow = Id.Workflow.from(Id.Namespace.from(namespaceId), appId, workflowId);\n+    Collection<WorkflowDataset.WorkflowRunRecord> workflowRunRecords =\n+      store.retrieveSpacedRecords(workflow, runId, count, timeInterval).values();\n+    Map<String, WorkflowStatistics.DetailedStatistics> detailedStatisticsMap = new HashMap<>();\n+    for (WorkflowDataset.WorkflowRunRecord workflowRunRecord : workflowRunRecords) {\n+      WorkflowStatistics.DetailedStatistics detailedStatistics =\n+        getDetailedRecord(workflow, workflowRunRecord.getWorkflowRunId());\n+      detailedStatisticsMap.put(workflowRunRecord.getWorkflowRunId(), detailedStatistics);\n+    }\n+    Map<String, Map<String, Map<String, Long>>> formattedStatisticsMap = convert(detailedStatisticsMap);\n+\n+    responder.sendJson(HttpResponseStatus.OK, formattedStatisticsMap);\n+  }\n+\n+  @GET\n+  @Path(\"apps/{app-id}/workflows/{workflow-id}/compare/run-id/{run-id}\")\n+  public void compare(HttpRequest request, HttpResponder responder,\n+                      @PathParam(\"namespace-id\") String namespaceId,\n+                      @PathParam(\"app-id\") String appId,\n+                      @PathParam(\"workflow-id\") String workflowId,\n+                      @PathParam(\"run-id\") String runId,\n+                      @QueryParam(\"other-run-id\") String otherRunId) throws Exception {\n+    Id.Workflow id = Id.Workflow.from(Id.Namespace.from(namespaceId), appId, workflowId);\n+    WorkflowStatistics.DetailedStatistics detailedStatistics = getDetailedRecord(id, runId);\n+    WorkflowStatistics.DetailedStatistics otherDetailedStatistics = getDetailedRecord(id, otherRunId);\n+    if (detailedStatistics == null) {\n+      responder.sendString(HttpResponseStatus.BAD_REQUEST, \"The run-id you provided was not correct.\");\n+      return;\n+    }\n+    if (otherDetailedStatistics == null) {\n+      responder.sendString(HttpResponseStatus.BAD_REQUEST, \"The other run-id you provided was not correct.\");\n+      return;\n+    }\n+    // TODO: Change format of return such that the results are intertwined.","path":"cdap-app-fabric/src/main/java/co/cask/cdap/gateway/handlers/WorkflowStatsSLAHttpHandler.java","position":99,"original_position":99,"commit_id":"23a8c07638f2f97e5570f8862de3b6345d5ff209","original_commit_id":"23a8c07638f2f97e5570f8862de3b6345d5ff209","user":{"login":"bdmogal","id":3895099,"avatar_url":"https://avatars.githubusercontent.com/u/3895099?v=3","gravatar_id":"","url":"https://api.github.com/users/bdmogal","html_url":"https://github.com/bdmogal","followers_url":"https://api.github.com/users/bdmogal/followers","following_url":"https://api.github.com/users/bdmogal/following{/other_user}","gists_url":"https://api.github.com/users/bdmogal/gists{/gist_id}","starred_url":"https://api.github.com/users/bdmogal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdmogal/subscriptions","organizations_url":"https://api.github.com/users/bdmogal/orgs","repos_url":"https://api.github.com/users/bdmogal/repos","events_url":"https://api.github.com/users/bdmogal/events{/privacy}","received_events_url":"https://api.github.com/users/bdmogal/received_events","type":"User","site_admin":false},"body":"if this is not applicable, remove","created_at":"2015-08-20T18:04:03Z","updated_at":"2015-08-20T18:04:03Z","html_url":"https://github.com/caskdata/cdap/pull/3646#discussion_r37561155","pull_request_url":"https://api.github.com/repos/caskdata/cdap/pulls/3646","_links":{"self":{"href":"https://api.github.com/repos/caskdata/cdap/pulls/comments/37561155"},"html":{"href":"https://github.com/caskdata/cdap/pull/3646#discussion_r37561155"},"pull_request":{"href":"https://api.github.com/repos/caskdata/cdap/pulls/3646"}}},"pull_request":{"url":"https://api.github.com/repos/caskdata/cdap/pulls/3646","id":42921633,"html_url":"https://github.com/caskdata/cdap/pull/3646","diff_url":"https://github.com/caskdata/cdap/pull/3646.diff","patch_url":"https://github.com/caskdata/cdap/pull/3646.patch","issue_url":"https://api.github.com/repos/caskdata/cdap/issues/3646","number":3646,"state":"open","locked":false,"title":"Feature/cdap-3372 workflow compare","user":{"login":"rohanahata","id":2381977,"avatar_url":"https://avatars.githubusercontent.com/u/2381977?v=3","gravatar_id":"","url":"https://api.github.com/users/rohanahata","html_url":"https://github.com/rohanahata","followers_url":"https://api.github.com/users/rohanahata/followers","following_url":"https://api.github.com/users/rohanahata/following{/other_user}","gists_url":"https://api.github.com/users/rohanahata/gists{/gist_id}","starred_url":"https://api.github.com/users/rohanahata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohanahata/subscriptions","organizations_url":"https://api.github.com/users/rohanahata/orgs","repos_url":"https://api.github.com/users/rohanahata/repos","events_url":"https://api.github.com/users/rohanahata/events{/privacy}","received_events_url":"https://api.github.com/users/rohanahata/received_events","type":"User","site_admin":false},"body":"The other 2 endpoints from the WorkflowStatsSla. \r\nhttps://issues.cask.co/browse/CDAP-3370\r\nhttp://builds.cask.co/browse/CDAP-DUT2570","created_at":"2015-08-20T12:05:38Z","updated_at":"2015-08-20T18:04:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2abd418cf62d652e3627be34733e7d4298ac0170","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/caskdata/cdap/pulls/3646/commits","review_comments_url":"https://api.github.com/repos/caskdata/cdap/pulls/3646/comments","review_comment_url":"https://api.github.com/repos/caskdata/cdap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/caskdata/cdap/issues/3646/comments","statuses_url":"https://api.github.com/repos/caskdata/cdap/statuses/23a8c07638f2f97e5570f8862de3b6345d5ff209","head":{"label":"caskdata:feature/CDAP-3372-workflow-compare-endpoint","ref":"feature/CDAP-3372-workflow-compare-endpoint","sha":"23a8c07638f2f97e5570f8862de3b6345d5ff209","user":{"login":"caskdata","id":8123023,"avatar_url":"https://avatars.githubusercontent.com/u/8123023?v=3","gravatar_id":"","url":"https://api.github.com/users/caskdata","html_url":"https://github.com/caskdata","followers_url":"https://api.github.com/users/caskdata/followers","following_url":"https://api.github.com/users/caskdata/following{/other_user}","gists_url":"https://api.github.com/users/caskdata/gists{/gist_id}","starred_url":"https://api.github.com/users/caskdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caskdata/subscriptions","organizations_url":"https://api.github.com/users/caskdata/orgs","repos_url":"https://api.github.com/users/caskdata/repos","events_url":"https://api.github.com/users/caskdata/events{/privacy}","received_events_url":"https://api.github.com/users/caskdata/received_events","type":"Organization","site_admin":false},"repo":{"id":22542759,"name":"cdap","full_name":"caskdata/cdap","owner":{"login":"caskdata","id":8123023,"avatar_url":"https://avatars.githubusercontent.com/u/8123023?v=3","gravatar_id":"","url":"https://api.github.com/users/caskdata","html_url":"https://github.com/caskdata","followers_url":"https://api.github.com/users/caskdata/followers","following_url":"https://api.github.com/users/caskdata/following{/other_user}","gists_url":"https://api.github.com/users/caskdata/gists{/gist_id}","starred_url":"https://api.github.com/users/caskdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caskdata/subscriptions","organizations_url":"https://api.github.com/users/caskdata/orgs","repos_url":"https://api.github.com/users/caskdata/repos","events_url":"https://api.github.com/users/caskdata/events{/privacy}","received_events_url":"https://api.github.com/users/caskdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/caskdata/cdap","description":"Cask Data Application Platform (CDAP)","fork":false,"url":"https://api.github.com/repos/caskdata/cdap","forks_url":"https://api.github.com/repos/caskdata/cdap/forks","keys_url":"https://api.github.com/repos/caskdata/cdap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caskdata/cdap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caskdata/cdap/teams","hooks_url":"https://api.github.com/repos/caskdata/cdap/hooks","issue_events_url":"https://api.github.com/repos/caskdata/cdap/issues/events{/number}","events_url":"https://api.github.com/repos/caskdata/cdap/events","assignees_url":"https://api.github.com/repos/caskdata/cdap/assignees{/user}","branches_url":"https://api.github.com/repos/caskdata/cdap/branches{/branch}","tags_url":"https://api.github.com/repos/caskdata/cdap/tags","blobs_url":"https://api.github.com/repos/caskdata/cdap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caskdata/cdap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caskdata/cdap/git/refs{/sha}","trees_url":"https://api.github.com/repos/caskdata/cdap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caskdata/cdap/statuses/{sha}","languages_url":"https://api.github.com/repos/caskdata/cdap/languages","stargazers_url":"https://api.github.com/repos/caskdata/cdap/stargazers","contributors_url":"https://api.github.com/repos/caskdata/cdap/contributors","subscribers_url":"https://api.github.com/repos/caskdata/cdap/subscribers","subscription_url":"https://api.github.com/repos/caskdata/cdap/subscription","commits_url":"https://api.github.com/repos/caskdata/cdap/commits{/sha}","git_commits_url":"https://api.github.com/repos/caskdata/cdap/git/commits{/sha}","comments_url":"https://api.github.com/repos/caskdata/cdap/comments{/number}","issue_comment_url":"https://api.github.com/repos/caskdata/cdap/issues/comments{/number}","contents_url":"https://api.github.com/repos/caskdata/cdap/contents/{+path}","compare_url":"https://api.github.com/repos/caskdata/cdap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caskdata/cdap/merges","archive_url":"https://api.github.com/repos/caskdata/cdap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caskdata/cdap/downloads","issues_url":"https://api.github.com/repos/caskdata/cdap/issues{/number}","pulls_url":"https://api.github.com/repos/caskdata/cdap/pulls{/number}","milestones_url":"https://api.github.com/repos/caskdata/cdap/milestones{/number}","notifications_url":"https://api.github.com/repos/caskdata/cdap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caskdata/cdap/labels{/name}","releases_url":"https://api.github.com/repos/caskdata/cdap/releases{/id}","created_at":"2014-08-02T09:00:10Z","updated_at":"2015-08-19T08:36:52Z","pushed_at":"2015-08-20T17:56:39Z","git_url":"git://github.com/caskdata/cdap.git","ssh_url":"git@github.com:caskdata/cdap.git","clone_url":"https://github.com/caskdata/cdap.git","svn_url":"https://github.com/caskdata/cdap","homepage":"http://cdap.io","size":852650,"stargazers_count":61,"watchers_count":61,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":19,"mirror_url":null,"open_issues_count":19,"forks":19,"open_issues":19,"watchers":61,"default_branch":"develop"}},"base":{"label":"caskdata:develop","ref":"develop","sha":"906946fbd083baf1c7ca7c0c184dc1da48efeb42","user":{"login":"caskdata","id":8123023,"avatar_url":"https://avatars.githubusercontent.com/u/8123023?v=3","gravatar_id":"","url":"https://api.github.com/users/caskdata","html_url":"https://github.com/caskdata","followers_url":"https://api.github.com/users/caskdata/followers","following_url":"https://api.github.com/users/caskdata/following{/other_user}","gists_url":"https://api.github.com/users/caskdata/gists{/gist_id}","starred_url":"https://api.github.com/users/caskdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caskdata/subscriptions","organizations_url":"https://api.github.com/users/caskdata/orgs","repos_url":"https://api.github.com/users/caskdata/repos","events_url":"https://api.github.com/users/caskdata/events{/privacy}","received_events_url":"https://api.github.com/users/caskdata/received_events","type":"Organization","site_admin":false},"repo":{"id":22542759,"name":"cdap","full_name":"caskdata/cdap","owner":{"login":"caskdata","id":8123023,"avatar_url":"https://avatars.githubusercontent.com/u/8123023?v=3","gravatar_id":"","url":"https://api.github.com/users/caskdata","html_url":"https://github.com/caskdata","followers_url":"https://api.github.com/users/caskdata/followers","following_url":"https://api.github.com/users/caskdata/following{/other_user}","gists_url":"https://api.github.com/users/caskdata/gists{/gist_id}","starred_url":"https://api.github.com/users/caskdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caskdata/subscriptions","organizations_url":"https://api.github.com/users/caskdata/orgs","repos_url":"https://api.github.com/users/caskdata/repos","events_url":"https://api.github.com/users/caskdata/events{/privacy}","received_events_url":"https://api.github.com/users/caskdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/caskdata/cdap","description":"Cask Data Application Platform (CDAP)","fork":false,"url":"https://api.github.com/repos/caskdata/cdap","forks_url":"https://api.github.com/repos/caskdata/cdap/forks","keys_url":"https://api.github.com/repos/caskdata/cdap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caskdata/cdap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caskdata/cdap/teams","hooks_url":"https://api.github.com/repos/caskdata/cdap/hooks","issue_events_url":"https://api.github.com/repos/caskdata/cdap/issues/events{/number}","events_url":"https://api.github.com/repos/caskdata/cdap/events","assignees_url":"https://api.github.com/repos/caskdata/cdap/assignees{/user}","branches_url":"https://api.github.com/repos/caskdata/cdap/branches{/branch}","tags_url":"https://api.github.com/repos/caskdata/cdap/tags","blobs_url":"https://api.github.com/repos/caskdata/cdap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caskdata/cdap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caskdata/cdap/git/refs{/sha}","trees_url":"https://api.github.com/repos/caskdata/cdap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caskdata/cdap/statuses/{sha}","languages_url":"https://api.github.com/repos/caskdata/cdap/languages","stargazers_url":"https://api.github.com/repos/caskdata/cdap/stargazers","contributors_url":"https://api.github.com/repos/caskdata/cdap/contributors","subscribers_url":"https://api.github.com/repos/caskdata/cdap/subscribers","subscription_url":"https://api.github.com/repos/caskdata/cdap/subscription","commits_url":"https://api.github.com/repos/caskdata/cdap/commits{/sha}","git_commits_url":"https://api.github.com/repos/caskdata/cdap/git/commits{/sha}","comments_url":"https://api.github.com/repos/caskdata/cdap/comments{/number}","issue_comment_url":"https://api.github.com/repos/caskdata/cdap/issues/comments{/number}","contents_url":"https://api.github.com/repos/caskdata/cdap/contents/{+path}","compare_url":"https://api.github.com/repos/caskdata/cdap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caskdata/cdap/merges","archive_url":"https://api.github.com/repos/caskdata/cdap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caskdata/cdap/downloads","issues_url":"https://api.github.com/repos/caskdata/cdap/issues{/number}","pulls_url":"https://api.github.com/repos/caskdata/cdap/pulls{/number}","milestones_url":"https://api.github.com/repos/caskdata/cdap/milestones{/number}","notifications_url":"https://api.github.com/repos/caskdata/cdap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caskdata/cdap/labels{/name}","releases_url":"https://api.github.com/repos/caskdata/cdap/releases{/id}","created_at":"2014-08-02T09:00:10Z","updated_at":"2015-08-19T08:36:52Z","pushed_at":"2015-08-20T17:56:39Z","git_url":"git://github.com/caskdata/cdap.git","ssh_url":"git@github.com:caskdata/cdap.git","clone_url":"https://github.com/caskdata/cdap.git","svn_url":"https://github.com/caskdata/cdap","homepage":"http://cdap.io","size":852650,"stargazers_count":61,"watchers_count":61,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":19,"mirror_url":null,"open_issues_count":19,"forks":19,"open_issues":19,"watchers":61,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/caskdata/cdap/pulls/3646"},"html":{"href":"https://github.com/caskdata/cdap/pull/3646"},"issue":{"href":"https://api.github.com/repos/caskdata/cdap/issues/3646"},"comments":{"href":"https://api.github.com/repos/caskdata/cdap/issues/3646/comments"},"review_comments":{"href":"https://api.github.com/repos/caskdata/cdap/pulls/3646/comments"},"review_comment":{"href":"https://api.github.com/repos/caskdata/cdap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/caskdata/cdap/pulls/3646/commits"},"statuses":{"href":"https://api.github.com/repos/caskdata/cdap/statuses/23a8c07638f2f97e5570f8862de3b6345d5ff209"}}}}