{"action":"created","comment":{"url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/pulls/comments/31888852","id":31888852,"diff_hunk":"@@ -114,7 +119,61 @@ public void setChanges(List<Change> changes) {\n         return changes;\n     }\n \n+    @Exported\n+    public long getTotalBuildTime() {\n+        return totalBuildTime;\n+    }\n \n+    public void setTotalBuildTime() {\n+        if (stages.size() == 0) {\n+            this.totalBuildTime = 0L;\n+        } else {\n+            List<Route> allRoutes = new ArrayList<Route>();\n+            calculatePipelineRoutes(getStages().get(0).getTasks().get(0), null, allRoutes);\n+            long maxTime = 0L;\n+            for (Route route : allRoutes) {\n+                long buildTime = route.getTotalBuildTime();\n+                if (buildTime > maxTime) {\n+                    maxTime = buildTime;\n+                }\n+            }\n+            this.totalBuildTime = maxTime;\n+        }\n+    }\n+\n+    private Route createRouteAndCopyTasks(final Route route, Task task) {\n+        Route currentRoute = new Route();\n+        if (route != null) {\n+            currentRoute.setTasks(newArrayList(route.getTasks()));\n+        }\n+        currentRoute.addTask(task);\n+        return currentRoute;\n+    }\n+\n+    public void calculatePipelineRoutes(Task task, final Route route, List<Route> allRoutes) {","path":"src/main/java/se/diabol/jenkins/pipeline/domain/Pipeline.java","position":56,"original_position":56,"commit_id":"87d708436c1a539830aee423e06b8fac41fdab47","original_commit_id":"87d708436c1a539830aee423e06b8fac41fdab47","user":{"login":"marcusphi","id":1379074,"avatar_url":"https://avatars.githubusercontent.com/u/1379074?v=3","gravatar_id":"","url":"https://api.github.com/users/marcusphi","html_url":"https://github.com/marcusphi","followers_url":"https://api.github.com/users/marcusphi/followers","following_url":"https://api.github.com/users/marcusphi/following{/other_user}","gists_url":"https://api.github.com/users/marcusphi/gists{/gist_id}","starred_url":"https://api.github.com/users/marcusphi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcusphi/subscriptions","organizations_url":"https://api.github.com/users/marcusphi/orgs","repos_url":"https://api.github.com/users/marcusphi/repos","events_url":"https://api.github.com/users/marcusphi/events{/privacy}","received_events_url":"https://api.github.com/users/marcusphi/received_events","type":"User","site_admin":false},"body":"Why not default, aka package-private?\n\nMarcus Philip\nTwitter: @marcus_phi\n\n> 8 jun 2015 kl. 02:35 skrev Zihao Yu <notifications@github.com>:\n> \n> In src/main/java/se/diabol/jenkins/pipeline/domain/Pipeline.java:\n> \n> > +                }\n> > +            }\n> > +            this.totalBuildTime = maxTime;\n> > +        }\n> > +    }\n> > +\n> > +    private Route createRouteAndCopyTasks(final Route route, Task task) {\n> > +        Route currentRoute = new Route();\n> > +        if (route != null) {\n> > +            currentRoute.setTasks(newArrayList(route.getTasks()));\n> > +        }\n> > +        currentRoute.addTask(task);\n> > +        return currentRoute;\n> > +    }\n> > +\n> > +    public void calculatePipelineRoutes(Task task, final Route route, List<Route> allRoutes) {\n> I wanted to test this method directly so I made it public. Do you suggest making it private?\n> \n> —\n> Reply to this email directly or view it on GitHub.\n> \n","created_at":"2015-06-08T06:20:29Z","updated_at":"2015-06-08T06:20:29Z","html_url":"https://github.com/Diabol/delivery-pipeline-plugin/pull/103#discussion_r31888852","pull_request_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/pulls/103","_links":{"self":{"href":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/pulls/comments/31888852"},"html":{"href":"https://github.com/Diabol/delivery-pipeline-plugin/pull/103#discussion_r31888852"},"pull_request":{"href":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/pulls/103"}}},"pull_request":{"url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/pulls/103","id":33581155,"html_url":"https://github.com/Diabol/delivery-pipeline-plugin/pull/103","diff_url":"https://github.com/Diabol/delivery-pipeline-plugin/pull/103.diff","patch_url":"https://github.com/Diabol/delivery-pipeline-plugin/pull/103.patch","issue_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/issues/103","number":103,"state":"open","locked":false,"title":"JENKINS-22482: Show total build time","user":{"login":"zihaoyu","id":464299,"avatar_url":"https://avatars.githubusercontent.com/u/464299?v=3","gravatar_id":"","url":"https://api.github.com/users/zihaoyu","html_url":"https://github.com/zihaoyu","followers_url":"https://api.github.com/users/zihaoyu/followers","following_url":"https://api.github.com/users/zihaoyu/following{/other_user}","gists_url":"https://api.github.com/users/zihaoyu/gists{/gist_id}","starred_url":"https://api.github.com/users/zihaoyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zihaoyu/subscriptions","organizations_url":"https://api.github.com/users/zihaoyu/orgs","repos_url":"https://api.github.com/users/zihaoyu/repos","events_url":"https://api.github.com/users/zihaoyu/events{/privacy}","received_events_url":"https://api.github.com/users/zihaoyu/received_events","type":"User","site_admin":false},"body":"by calculating all possible routes in a pipeline, and pick the route with largest total duration value. Total duration value is the sum of durations of each task in that route.","created_at":"2015-04-17T20:49:44Z","updated_at":"2015-06-08T06:20:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"428425fbabc9ae0e919b3d7b5439bac7ad389264","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/pulls/103/commits","review_comments_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/pulls/103/comments","review_comment_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/issues/103/comments","statuses_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/statuses/87d708436c1a539830aee423e06b8fac41fdab47","head":{"label":"zihaoyu:pipeline-runtime","ref":"pipeline-runtime","sha":"87d708436c1a539830aee423e06b8fac41fdab47","user":{"login":"zihaoyu","id":464299,"avatar_url":"https://avatars.githubusercontent.com/u/464299?v=3","gravatar_id":"","url":"https://api.github.com/users/zihaoyu","html_url":"https://github.com/zihaoyu","followers_url":"https://api.github.com/users/zihaoyu/followers","following_url":"https://api.github.com/users/zihaoyu/following{/other_user}","gists_url":"https://api.github.com/users/zihaoyu/gists{/gist_id}","starred_url":"https://api.github.com/users/zihaoyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zihaoyu/subscriptions","organizations_url":"https://api.github.com/users/zihaoyu/orgs","repos_url":"https://api.github.com/users/zihaoyu/repos","events_url":"https://api.github.com/users/zihaoyu/events{/privacy}","received_events_url":"https://api.github.com/users/zihaoyu/received_events","type":"User","site_admin":false},"repo":{"id":18342489,"name":"delivery-pipeline-plugin","full_name":"zihaoyu/delivery-pipeline-plugin","owner":{"login":"zihaoyu","id":464299,"avatar_url":"https://avatars.githubusercontent.com/u/464299?v=3","gravatar_id":"","url":"https://api.github.com/users/zihaoyu","html_url":"https://github.com/zihaoyu","followers_url":"https://api.github.com/users/zihaoyu/followers","following_url":"https://api.github.com/users/zihaoyu/following{/other_user}","gists_url":"https://api.github.com/users/zihaoyu/gists{/gist_id}","starred_url":"https://api.github.com/users/zihaoyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zihaoyu/subscriptions","organizations_url":"https://api.github.com/users/zihaoyu/orgs","repos_url":"https://api.github.com/users/zihaoyu/repos","events_url":"https://api.github.com/users/zihaoyu/events{/privacy}","received_events_url":"https://api.github.com/users/zihaoyu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zihaoyu/delivery-pipeline-plugin","description":"Jenkins plugin for pipeline visualisation, perfect for Continuous Delivery ","fork":true,"url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin","forks_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/forks","keys_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/teams","hooks_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/hooks","issue_events_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/events","assignees_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/tags","blobs_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/languages","stargazers_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/stargazers","contributors_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/contributors","subscribers_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/subscribers","subscription_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/subscription","commits_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/merges","archive_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/downloads","issues_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/labels{/name}","releases_url":"https://api.github.com/repos/zihaoyu/delivery-pipeline-plugin/releases{/id}","created_at":"2014-04-01T19:54:54Z","updated_at":"2014-06-20T15:18:53Z","pushed_at":"2015-05-04T20:34:10Z","git_url":"git://github.com/zihaoyu/delivery-pipeline-plugin.git","ssh_url":"git@github.com:zihaoyu/delivery-pipeline-plugin.git","clone_url":"https://github.com/zihaoyu/delivery-pipeline-plugin.git","svn_url":"https://github.com/zihaoyu/delivery-pipeline-plugin","homepage":"","size":1447,"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":"Diabol:master","ref":"master","sha":"1408fab8caff3e17bf5d04c6fc37d9f25492086a","user":{"login":"Diabol","id":1213435,"avatar_url":"https://avatars.githubusercontent.com/u/1213435?v=3","gravatar_id":"","url":"https://api.github.com/users/Diabol","html_url":"https://github.com/Diabol","followers_url":"https://api.github.com/users/Diabol/followers","following_url":"https://api.github.com/users/Diabol/following{/other_user}","gists_url":"https://api.github.com/users/Diabol/gists{/gist_id}","starred_url":"https://api.github.com/users/Diabol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Diabol/subscriptions","organizations_url":"https://api.github.com/users/Diabol/orgs","repos_url":"https://api.github.com/users/Diabol/repos","events_url":"https://api.github.com/users/Diabol/events{/privacy}","received_events_url":"https://api.github.com/users/Diabol/received_events","type":"Organization","site_admin":false},"repo":{"id":9543349,"name":"delivery-pipeline-plugin","full_name":"Diabol/delivery-pipeline-plugin","owner":{"login":"Diabol","id":1213435,"avatar_url":"https://avatars.githubusercontent.com/u/1213435?v=3","gravatar_id":"","url":"https://api.github.com/users/Diabol","html_url":"https://github.com/Diabol","followers_url":"https://api.github.com/users/Diabol/followers","following_url":"https://api.github.com/users/Diabol/following{/other_user}","gists_url":"https://api.github.com/users/Diabol/gists{/gist_id}","starred_url":"https://api.github.com/users/Diabol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Diabol/subscriptions","organizations_url":"https://api.github.com/users/Diabol/orgs","repos_url":"https://api.github.com/users/Diabol/repos","events_url":"https://api.github.com/users/Diabol/events{/privacy}","received_events_url":"https://api.github.com/users/Diabol/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Diabol/delivery-pipeline-plugin","description":"Jenkins plugin for pipeline visualisation, perfect for Continuous Delivery ","fork":false,"url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin","forks_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/forks","keys_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/teams","hooks_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/hooks","issue_events_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/events","assignees_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/tags","blobs_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/languages","stargazers_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/stargazers","contributors_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/contributors","subscribers_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/subscribers","subscription_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/subscription","commits_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/merges","archive_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/downloads","issues_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/labels{/name}","releases_url":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/releases{/id}","created_at":"2013-04-19T10:46:35Z","updated_at":"2015-05-21T14:47:11Z","pushed_at":"2015-06-06T18:31:12Z","git_url":"git://github.com/Diabol/delivery-pipeline-plugin.git","ssh_url":"git@github.com:Diabol/delivery-pipeline-plugin.git","clone_url":"https://github.com/Diabol/delivery-pipeline-plugin.git","svn_url":"https://github.com/Diabol/delivery-pipeline-plugin","homepage":"","size":4256,"stargazers_count":32,"watchers_count":32,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":3,"forks":36,"open_issues":3,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/pulls/103"},"html":{"href":"https://github.com/Diabol/delivery-pipeline-plugin/pull/103"},"issue":{"href":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/issues/103"},"comments":{"href":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/issues/103/comments"},"review_comments":{"href":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/pulls/103/comments"},"review_comment":{"href":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/pulls/103/commits"},"statuses":{"href":"https://api.github.com/repos/Diabol/delivery-pipeline-plugin/statuses/87d708436c1a539830aee423e06b8fac41fdab47"}}}}