{"action":"created","comment":{"url":"https://api.github.com/repos/gocd/gocd/pulls/comments/92415863","pull_request_review_id":12930276,"id":92415863,"diff_hunk":"@@ -68,15 +77,21 @@ public double priority() {\n         return json;\n     }\n \n-    private TreeMap<Long, Map<String, Object>> getStackTraceInformation(ThreadMXBean threadMXBean) {\n+    private TreeMap<Long, Map<String, Object>> getThreadInformation(ThreadMXBean threadMXBean) {\n         TreeMap<Long, Map<String, Object>> traces = new TreeMap<>();\n         ThreadInfo[] threadInfos = threadMXBean.dumpAllThreads(true, true);\n         for (ThreadInfo threadInfo : threadInfos) {\n             LinkedHashMap<String, Object> threadStackTrace = new LinkedHashMap<>();\n             threadStackTrace.put(\"Id\", threadInfo.getThreadId());\n             threadStackTrace.put(\"Name\", threadInfo.getThreadName());\n             threadStackTrace.put(\"State\", threadInfo.getThreadState());\n-\n+            threadStackTrace.put(\"UserTime(nanoseconds)\", threadMXBean.getThreadUserTime(threadInfo.getThreadId()));\n+            threadStackTrace.put(\"CPUTime(nanoseconds)\", threadMXBean.getThreadCpuTime(threadInfo.getThreadId()));\n+            threadStackTrace.put(\"DaemonThreadInfo\", daemonThreadStatsCollector.statsFor(threadInfo.getThreadId()));\n+            if (threadMXBean instanceof com.sun.management.ThreadMXBean) {","path":"server/src/com/thoughtworks/go/server/service/support/ThreadInformationProvider.java","position":42,"original_position":42,"commit_id":"b9ae3295b07c5c82f31f47a2a83d93a964239e1e","original_commit_id":"b9ae3295b07c5c82f31f47a2a83d93a964239e1e","user":{"login":"ketan","id":10598,"avatar_url":"https://avatars.githubusercontent.com/u/10598?v=3","gravatar_id":"","url":"https://api.github.com/users/ketan","html_url":"https://github.com/ketan","followers_url":"https://api.github.com/users/ketan/followers","following_url":"https://api.github.com/users/ketan/following{/other_user}","gists_url":"https://api.github.com/users/ketan/gists{/gist_id}","starred_url":"https://api.github.com/users/ketan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketan/subscriptions","organizations_url":"https://api.github.com/users/ketan/orgs","repos_url":"https://api.github.com/users/ketan/repos","events_url":"https://api.github.com/users/ketan/events{/privacy}","received_events_url":"https://api.github.com/users/ketan/received_events","type":"User","site_admin":false},"body":"Casting to this seems dangerous? Can we instead duck-type?\r\n\r\n```\r\nmethod = org.springframework.util.ReflectionUtils.findMethod(threadMXBean.getClass(), \"getThreadAllocatedBytes\")\r\nif (method != null) {\r\n  bytes = org.springframework.util.ReflectionUtils.invokeMethod(method, threadMXBean, threadInfo,getThreadId());\r\n  threadStackTrace.put(\"AllocatedMemory(Bytes)\", bytes);\r\n}\r\n```\r\n","created_at":"2016-12-14T15:25:24Z","updated_at":"2016-12-14T16:01:11Z","html_url":"https://github.com/gocd/gocd/pull/3006#discussion_r92415863","pull_request_url":"https://api.github.com/repos/gocd/gocd/pulls/3006","_links":{"self":{"href":"https://api.github.com/repos/gocd/gocd/pulls/comments/92415863"},"html":{"href":"https://github.com/gocd/gocd/pull/3006#discussion_r92415863"},"pull_request":{"href":"https://api.github.com/repos/gocd/gocd/pulls/3006"}}},"pull_request":{"url":"https://api.github.com/repos/gocd/gocd/pulls/3006","id":97913304,"html_url":"https://github.com/gocd/gocd/pull/3006","diff_url":"https://github.com/gocd/gocd/pull/3006.diff","patch_url":"https://github.com/gocd/gocd/pull/3006.patch","issue_url":"https://api.github.com/repos/gocd/gocd/issues/3006","number":3006,"state":"open","locked":false,"title":"Adding CPU time in api/support for the threads.","user":{"login":"jyotisingh","id":1046342,"avatar_url":"https://avatars.githubusercontent.com/u/1046342?v=3","gravatar_id":"","url":"https://api.github.com/users/jyotisingh","html_url":"https://github.com/jyotisingh","followers_url":"https://api.github.com/users/jyotisingh/followers","following_url":"https://api.github.com/users/jyotisingh/following{/other_user}","gists_url":"https://api.github.com/users/jyotisingh/gists{/gist_id}","starred_url":"https://api.github.com/users/jyotisingh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyotisingh/subscriptions","organizations_url":"https://api.github.com/users/jyotisingh/orgs","repos_url":"https://api.github.com/users/jyotisingh/repos","events_url":"https://api.github.com/users/jyotisingh/events{/privacy}","received_events_url":"https://api.github.com/users/jyotisingh/received_events","type":"User","site_admin":false},"body":"* CPU time for all threads\r\n* CPU consumed by the current set of operations for daemon threads used for MDU/Scheduling etc\r\n* AllocatedMemory for each thread\r\n* Capturing of allocated-memory, thread-wait times and thread-blocked times are not enabled by default. Enabling capturing of these stats based on a diagnostics flag","created_at":"2016-12-14T09:16:23Z","updated_at":"2016-12-14T16:01:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7ea84effa1ad55053c56d7190fb421ab2bdd57d2","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/gocd/gocd/milestones/24","html_url":"https://github.com/gocd/gocd/milestone/24","labels_url":"https://api.github.com/repos/gocd/gocd/milestones/24/labels","id":2157164,"number":24,"title":"Release 17.1","description":"","creator":{"login":"ketan","id":10598,"avatar_url":"https://avatars.githubusercontent.com/u/10598?v=3","gravatar_id":"","url":"https://api.github.com/users/ketan","html_url":"https://github.com/ketan","followers_url":"https://api.github.com/users/ketan/followers","following_url":"https://api.github.com/users/ketan/following{/other_user}","gists_url":"https://api.github.com/users/ketan/gists{/gist_id}","starred_url":"https://api.github.com/users/ketan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ketan/subscriptions","organizations_url":"https://api.github.com/users/ketan/orgs","repos_url":"https://api.github.com/users/ketan/repos","events_url":"https://api.github.com/users/ketan/events{/privacy}","received_events_url":"https://api.github.com/users/ketan/received_events","type":"User","site_admin":false},"open_issues":34,"closed_issues":14,"state":"open","created_at":"2016-11-25T08:17:26Z","updated_at":"2016-12-14T09:16:23Z","due_on":"2017-01-09T00:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/gocd/gocd/pulls/3006/commits","review_comments_url":"https://api.github.com/repos/gocd/gocd/pulls/3006/comments","review_comment_url":"https://api.github.com/repos/gocd/gocd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gocd/gocd/issues/3006/comments","statuses_url":"https://api.github.com/repos/gocd/gocd/statuses/b9ae3295b07c5c82f31f47a2a83d93a964239e1e","head":{"label":"jyotisingh:cpu_info_in_api_support","ref":"cpu_info_in_api_support","sha":"b9ae3295b07c5c82f31f47a2a83d93a964239e1e","user":{"login":"jyotisingh","id":1046342,"avatar_url":"https://avatars.githubusercontent.com/u/1046342?v=3","gravatar_id":"","url":"https://api.github.com/users/jyotisingh","html_url":"https://github.com/jyotisingh","followers_url":"https://api.github.com/users/jyotisingh/followers","following_url":"https://api.github.com/users/jyotisingh/following{/other_user}","gists_url":"https://api.github.com/users/jyotisingh/gists{/gist_id}","starred_url":"https://api.github.com/users/jyotisingh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyotisingh/subscriptions","organizations_url":"https://api.github.com/users/jyotisingh/orgs","repos_url":"https://api.github.com/users/jyotisingh/repos","events_url":"https://api.github.com/users/jyotisingh/events{/privacy}","received_events_url":"https://api.github.com/users/jyotisingh/received_events","type":"User","site_admin":false},"repo":{"id":21679740,"name":"gocd","full_name":"jyotisingh/gocd","owner":{"login":"jyotisingh","id":1046342,"avatar_url":"https://avatars.githubusercontent.com/u/1046342?v=3","gravatar_id":"","url":"https://api.github.com/users/jyotisingh","html_url":"https://github.com/jyotisingh","followers_url":"https://api.github.com/users/jyotisingh/followers","following_url":"https://api.github.com/users/jyotisingh/following{/other_user}","gists_url":"https://api.github.com/users/jyotisingh/gists{/gist_id}","starred_url":"https://api.github.com/users/jyotisingh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyotisingh/subscriptions","organizations_url":"https://api.github.com/users/jyotisingh/orgs","repos_url":"https://api.github.com/users/jyotisingh/repos","events_url":"https://api.github.com/users/jyotisingh/events{/privacy}","received_events_url":"https://api.github.com/users/jyotisingh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jyotisingh/gocd","description":"Main repository for Go Continuous Delivery","fork":true,"url":"https://api.github.com/repos/jyotisingh/gocd","forks_url":"https://api.github.com/repos/jyotisingh/gocd/forks","keys_url":"https://api.github.com/repos/jyotisingh/gocd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jyotisingh/gocd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jyotisingh/gocd/teams","hooks_url":"https://api.github.com/repos/jyotisingh/gocd/hooks","issue_events_url":"https://api.github.com/repos/jyotisingh/gocd/issues/events{/number}","events_url":"https://api.github.com/repos/jyotisingh/gocd/events","assignees_url":"https://api.github.com/repos/jyotisingh/gocd/assignees{/user}","branches_url":"https://api.github.com/repos/jyotisingh/gocd/branches{/branch}","tags_url":"https://api.github.com/repos/jyotisingh/gocd/tags","blobs_url":"https://api.github.com/repos/jyotisingh/gocd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jyotisingh/gocd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jyotisingh/gocd/git/refs{/sha}","trees_url":"https://api.github.com/repos/jyotisingh/gocd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jyotisingh/gocd/statuses/{sha}","languages_url":"https://api.github.com/repos/jyotisingh/gocd/languages","stargazers_url":"https://api.github.com/repos/jyotisingh/gocd/stargazers","contributors_url":"https://api.github.com/repos/jyotisingh/gocd/contributors","subscribers_url":"https://api.github.com/repos/jyotisingh/gocd/subscribers","subscription_url":"https://api.github.com/repos/jyotisingh/gocd/subscription","commits_url":"https://api.github.com/repos/jyotisingh/gocd/commits{/sha}","git_commits_url":"https://api.github.com/repos/jyotisingh/gocd/git/commits{/sha}","comments_url":"https://api.github.com/repos/jyotisingh/gocd/comments{/number}","issue_comment_url":"https://api.github.com/repos/jyotisingh/gocd/issues/comments{/number}","contents_url":"https://api.github.com/repos/jyotisingh/gocd/contents/{+path}","compare_url":"https://api.github.com/repos/jyotisingh/gocd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jyotisingh/gocd/merges","archive_url":"https://api.github.com/repos/jyotisingh/gocd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jyotisingh/gocd/downloads","issues_url":"https://api.github.com/repos/jyotisingh/gocd/issues{/number}","pulls_url":"https://api.github.com/repos/jyotisingh/gocd/pulls{/number}","milestones_url":"https://api.github.com/repos/jyotisingh/gocd/milestones{/number}","notifications_url":"https://api.github.com/repos/jyotisingh/gocd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jyotisingh/gocd/labels{/name}","releases_url":"https://api.github.com/repos/jyotisingh/gocd/releases{/id}","deployments_url":"https://api.github.com/repos/jyotisingh/gocd/deployments","created_at":"2014-07-10T04:52:59Z","updated_at":"2016-01-11T10:13:36Z","pushed_at":"2016-12-14T09:16:55Z","git_url":"git://github.com/jyotisingh/gocd.git","ssh_url":"git@github.com:jyotisingh/gocd.git","clone_url":"https://github.com/jyotisingh/gocd.git","svn_url":"https://github.com/jyotisingh/gocd","homepage":null,"size":245736,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"gocd:master","ref":"master","sha":"74fd806d1a8abbbd010949d4a7aee16ae950231e","user":{"login":"gocd","id":6099846,"avatar_url":"https://avatars.githubusercontent.com/u/6099846?v=3","gravatar_id":"","url":"https://api.github.com/users/gocd","html_url":"https://github.com/gocd","followers_url":"https://api.github.com/users/gocd/followers","following_url":"https://api.github.com/users/gocd/following{/other_user}","gists_url":"https://api.github.com/users/gocd/gists{/gist_id}","starred_url":"https://api.github.com/users/gocd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocd/subscriptions","organizations_url":"https://api.github.com/users/gocd/orgs","repos_url":"https://api.github.com/users/gocd/repos","events_url":"https://api.github.com/users/gocd/events{/privacy}","received_events_url":"https://api.github.com/users/gocd/received_events","type":"Organization","site_admin":false},"repo":{"id":15155534,"name":"gocd","full_name":"gocd/gocd","owner":{"login":"gocd","id":6099846,"avatar_url":"https://avatars.githubusercontent.com/u/6099846?v=3","gravatar_id":"","url":"https://api.github.com/users/gocd","html_url":"https://github.com/gocd","followers_url":"https://api.github.com/users/gocd/followers","following_url":"https://api.github.com/users/gocd/following{/other_user}","gists_url":"https://api.github.com/users/gocd/gists{/gist_id}","starred_url":"https://api.github.com/users/gocd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gocd/subscriptions","organizations_url":"https://api.github.com/users/gocd/orgs","repos_url":"https://api.github.com/users/gocd/repos","events_url":"https://api.github.com/users/gocd/events{/privacy}","received_events_url":"https://api.github.com/users/gocd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gocd/gocd","description":"Main repository for GoCD - Continuous Delivery server","fork":false,"url":"https://api.github.com/repos/gocd/gocd","forks_url":"https://api.github.com/repos/gocd/gocd/forks","keys_url":"https://api.github.com/repos/gocd/gocd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gocd/gocd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gocd/gocd/teams","hooks_url":"https://api.github.com/repos/gocd/gocd/hooks","issue_events_url":"https://api.github.com/repos/gocd/gocd/issues/events{/number}","events_url":"https://api.github.com/repos/gocd/gocd/events","assignees_url":"https://api.github.com/repos/gocd/gocd/assignees{/user}","branches_url":"https://api.github.com/repos/gocd/gocd/branches{/branch}","tags_url":"https://api.github.com/repos/gocd/gocd/tags","blobs_url":"https://api.github.com/repos/gocd/gocd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gocd/gocd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gocd/gocd/git/refs{/sha}","trees_url":"https://api.github.com/repos/gocd/gocd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gocd/gocd/statuses/{sha}","languages_url":"https://api.github.com/repos/gocd/gocd/languages","stargazers_url":"https://api.github.com/repos/gocd/gocd/stargazers","contributors_url":"https://api.github.com/repos/gocd/gocd/contributors","subscribers_url":"https://api.github.com/repos/gocd/gocd/subscribers","subscription_url":"https://api.github.com/repos/gocd/gocd/subscription","commits_url":"https://api.github.com/repos/gocd/gocd/commits{/sha}","git_commits_url":"https://api.github.com/repos/gocd/gocd/git/commits{/sha}","comments_url":"https://api.github.com/repos/gocd/gocd/comments{/number}","issue_comment_url":"https://api.github.com/repos/gocd/gocd/issues/comments{/number}","contents_url":"https://api.github.com/repos/gocd/gocd/contents/{+path}","compare_url":"https://api.github.com/repos/gocd/gocd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gocd/gocd/merges","archive_url":"https://api.github.com/repos/gocd/gocd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gocd/gocd/downloads","issues_url":"https://api.github.com/repos/gocd/gocd/issues{/number}","pulls_url":"https://api.github.com/repos/gocd/gocd/pulls{/number}","milestones_url":"https://api.github.com/repos/gocd/gocd/milestones{/number}","notifications_url":"https://api.github.com/repos/gocd/gocd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gocd/gocd/labels{/name}","releases_url":"https://api.github.com/repos/gocd/gocd/releases{/id}","deployments_url":"https://api.github.com/repos/gocd/gocd/deployments","created_at":"2013-12-13T05:26:16Z","updated_at":"2016-12-14T14:47:31Z","pushed_at":"2016-12-14T10:01:39Z","git_url":"git://github.com/gocd/gocd.git","ssh_url":"git@github.com:gocd/gocd.git","clone_url":"https://github.com/gocd/gocd.git","svn_url":"https://github.com/gocd/gocd","homepage":"https://go.cd","size":245548,"stargazers_count":2784,"watchers_count":2784,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":518,"mirror_url":null,"open_issues_count":681,"forks":518,"open_issues":681,"watchers":2784,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gocd/gocd/pulls/3006"},"html":{"href":"https://github.com/gocd/gocd/pull/3006"},"issue":{"href":"https://api.github.com/repos/gocd/gocd/issues/3006"},"comments":{"href":"https://api.github.com/repos/gocd/gocd/issues/3006/comments"},"review_comments":{"href":"https://api.github.com/repos/gocd/gocd/pulls/3006/comments"},"review_comment":{"href":"https://api.github.com/repos/gocd/gocd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gocd/gocd/pulls/3006/commits"},"statuses":{"href":"https://api.github.com/repos/gocd/gocd/statuses/b9ae3295b07c5c82f31f47a2a83d93a964239e1e"}}}}
{"actor":{"display_login":"ketan"}}