{"action":"created","issue":{"url":"https://api.github.com/repos/sbt/sbt/issues/2210","labels_url":"https://api.github.com/repos/sbt/sbt/issues/2210/labels{/name}","comments_url":"https://api.github.com/repos/sbt/sbt/issues/2210/comments","events_url":"https://api.github.com/repos/sbt/sbt/issues/2210/events","html_url":"https://github.com/sbt/sbt/pull/2210","id":106926949,"number":2210,"title":"Improve time measuring capabilities (1.0.X)","user":{"login":"DavidPerezIngeniero","id":6008104,"avatar_url":"https://avatars.githubusercontent.com/u/6008104?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidPerezIngeniero","html_url":"https://github.com/DavidPerezIngeniero","followers_url":"https://api.github.com/users/DavidPerezIngeniero/followers","following_url":"https://api.github.com/users/DavidPerezIngeniero/following{/other_user}","gists_url":"https://api.github.com/users/DavidPerezIngeniero/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidPerezIngeniero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidPerezIngeniero/subscriptions","organizations_url":"https://api.github.com/users/DavidPerezIngeniero/orgs","repos_url":"https://api.github.com/users/DavidPerezIngeniero/repos","events_url":"https://api.github.com/users/DavidPerezIngeniero/events{/privacy}","received_events_url":"https://api.github.com/users/DavidPerezIngeniero/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sbt/sbt/labels/ready","name":"ready","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-17T07:32:49Z","updated_at":"2015-09-17T07:43:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sbt/sbt/pulls/2210","html_url":"https://github.com/sbt/sbt/pull/2210","diff_url":"https://github.com/sbt/sbt/pull/2210.diff","patch_url":"https://github.com/sbt/sbt/pull/2210.patch"},"body":"Currently, by setting -Dsbt.task.timing=true, time execution of tasks is measured.\r\n\r\nIt has the following limitations:\r\n\r\n- A very long number of decimals, that makes it unreadable. Example:\r\n```\r\n{file:/home/d/rds/project/}rds-build/compile:resources: 0.015903999999999998 ms\r\n```\r\n- Some tasks like compile are composed of a large number of tasks. Many of them are quite quick to execute. Normally, we want to know the long running tasks.\r\n- If you call in the command line sbt task1 task2 task3, I'd like the report to be at the end. Otherwise, I have to read the full output, that can be very verbose, in order to study running times.\r\n\r\nHere is my solution:\r\n\r\n- By setting the property -Dsbt.task.timings.unit=string, we can select the desired unit: ns, us (microseconds), ms, s.\r\n- Info is aligned for improving readability:\r\n```\r\nTotal time: 210 sec\r\n  {file:/home/d/rds/}servision/compile:compileIncremental: 63 sec\r\n  {file:/home/d/rds/}servision/test:compileIncremental   : 37 sec\r\n  {file:/home/d/rds/}servision/*:update                  : 35 sec\r\n  {file:/home/d/rds/}servision/*:compilaJython           : 20 sec\r\n  */*:descargaPylib                                      : 11 sec\r\n  {file:/home/d/rds/}iText/compile:compileIncremental    : 10 sec\r\n  {file:/home/d/rds/}ddlUtils/compile:compileIncremental :  8 sec\r\n```\r\n- By setting the property -Dsbt.task.timings.threshold=number, tasks whose duration is lower than the given number will be hidden. The threshold will take into account the selected unit set by `sbt.task.timings.unit` property. In this way we avoid noise.\r\n- By setting the property -Dsbt.task.timings.on.shutdown=true, the report is generated when finishing the JVM, instead of when finishing running a specified task.  It is more appropiate when SBT is used in batch mode, instead of interactive mode.\r\n\r\n\r\nNote:\r\n\r\nCommit 3fe9809 belongs to pull request #1940\r\nI forgot to push this commit when doing the pull request, that is a very trivial issue."},"comment":{"url":"https://api.github.com/repos/sbt/sbt/issues/comments/140993901","html_url":"https://github.com/sbt/sbt/pull/2210#issuecomment-140993901","issue_url":"https://api.github.com/repos/sbt/sbt/issues/2210","id":140993901,"user":{"login":"dwijnand","id":344610,"avatar_url":"https://avatars.githubusercontent.com/u/344610?v=3","gravatar_id":"","url":"https://api.github.com/users/dwijnand","html_url":"https://github.com/dwijnand","followers_url":"https://api.github.com/users/dwijnand/followers","following_url":"https://api.github.com/users/dwijnand/following{/other_user}","gists_url":"https://api.github.com/users/dwijnand/gists{/gist_id}","starred_url":"https://api.github.com/users/dwijnand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwijnand/subscriptions","organizations_url":"https://api.github.com/users/dwijnand/orgs","repos_url":"https://api.github.com/users/dwijnand/repos","events_url":"https://api.github.com/users/dwijnand/events{/privacy}","received_events_url":"https://api.github.com/users/dwijnand/received_events","type":"User","site_admin":false},"created_at":"2015-09-17T07:43:00Z","updated_at":"2015-09-17T07:43:00Z","body":"I'll look into how to make `-Dsbt.task.timings.threshold` take a String that's Duration parses."}}