{"action":"created","comment":{"url":"https://api.github.com/repos/prometheus/client_java/pulls/comments/94112767","pull_request_review_id":14642801,"id":94112767,"diff_hunk":"@@ -138,22 +138,44 @@ protected Child newChild() {\n     return new Child(quantiles, maxAgeSeconds, ageBuckets);\n   }\n \n+\n+  public static class SimpleTimer {","path":"simpleclient/src/main/java/io/prometheus/client/Summary.java","position":5,"original_position":5,"commit_id":"2b6c21bbfd41f1fef1a2abf5366401ea7df55a96","original_commit_id":"2b6c21bbfd41f1fef1a2abf5366401ea7df55a96","user":{"login":"brian-brazil","id":7115638,"avatar_url":"https://avatars.githubusercontent.com/u/7115638?v=3","gravatar_id":"","url":"https://api.github.com/users/brian-brazil","html_url":"https://github.com/brian-brazil","followers_url":"https://api.github.com/users/brian-brazil/followers","following_url":"https://api.github.com/users/brian-brazil/following{/other_user}","gists_url":"https://api.github.com/users/brian-brazil/gists{/gist_id}","starred_url":"https://api.github.com/users/brian-brazil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brian-brazil/subscriptions","organizations_url":"https://api.github.com/users/brian-brazil/orgs","repos_url":"https://api.github.com/users/brian-brazil/repos","events_url":"https://api.github.com/users/brian-brazil/events{/privacy}","received_events_url":"https://api.github.com/users/brian-brazil/received_events","type":"User","site_admin":false},"body":"This would apply to Histograms too. It probably makes the most sense for it to be a top-level class.\r\n\r\nIt should also have javafoc showing correct usage, and pointing users to the simpler methods they probably actually want.","created_at":"2016-12-29T08:46:18Z","updated_at":"2016-12-29T08:46:25Z","html_url":"https://github.com/prometheus/client_java/pull/172#discussion_r94112767","pull_request_url":"https://api.github.com/repos/prometheus/client_java/pulls/172","_links":{"self":{"href":"https://api.github.com/repos/prometheus/client_java/pulls/comments/94112767"},"html":{"href":"https://github.com/prometheus/client_java/pull/172#discussion_r94112767"},"pull_request":{"href":"https://api.github.com/repos/prometheus/client_java/pulls/172"}}},"pull_request":{"url":"https://api.github.com/repos/prometheus/client_java/pulls/172","id":99628835,"html_url":"https://github.com/prometheus/client_java/pull/172","diff_url":"https://github.com/prometheus/client_java/pull/172.diff","patch_url":"https://github.com/prometheus/client_java/pull/172.patch","issue_url":"https://api.github.com/repos/prometheus/client_java/issues/172","number":172,"state":"open","locked":false,"title":"Expose `SimpleTimer` to keep timing logic that returns elapsed seconds","user":{"login":"checketts","id":416063,"avatar_url":"https://avatars.githubusercontent.com/u/416063?v=3","gravatar_id":"","url":"https://api.github.com/users/checketts","html_url":"https://github.com/checketts","followers_url":"https://api.github.com/users/checketts/followers","following_url":"https://api.github.com/users/checketts/following{/other_user}","gists_url":"https://api.github.com/users/checketts/gists{/gist_id}","starred_url":"https://api.github.com/users/checketts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/checketts/subscriptions","organizations_url":"https://api.github.com/users/checketts/orgs","repos_url":"https://api.github.com/users/checketts/repos","events_url":"https://api.github.com/users/checketts/events{/privacy}","received_events_url":"https://api.github.com/users/checketts/received_events","type":"User","site_admin":false},"body":"This is regards to https://github.com/prometheus/client_java/issues/165\r\n\r\nAs team mates have begun using `Summary` objects, they find that they can't use the built in timer as they have a label like `success=\"true|false\"` they want to include when recording the observation.\r\n\r\nI've noticed 2 results: they use something like Guava's `StopWatch` (https://google.github.io/guava/releases/19.0/api/docs/com/google/common/base/Stopwatch.html) class that returns longs (ie using `Duration.Seconds` truncates) or do the math in elapsed milliseconds as longs. I'm convinced of the Prometheus doc recommendations to use seconds (and @brian-brazil article at https://www.robustperception.io/who-wants-seconds/) so I wanted to create a very simple option that supports seconds as doubles.","created_at":"2016-12-29T08:11:58Z","updated_at":"2016-12-29T08:46:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9cedd8611047b84e9c1fc05990806212748d8f01","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/prometheus/client_java/pulls/172/commits","review_comments_url":"https://api.github.com/repos/prometheus/client_java/pulls/172/comments","review_comment_url":"https://api.github.com/repos/prometheus/client_java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prometheus/client_java/issues/172/comments","statuses_url":"https://api.github.com/repos/prometheus/client_java/statuses/2b6c21bbfd41f1fef1a2abf5366401ea7df55a96","head":{"label":"checketts:master","ref":"master","sha":"2b6c21bbfd41f1fef1a2abf5366401ea7df55a96","user":{"login":"checketts","id":416063,"avatar_url":"https://avatars.githubusercontent.com/u/416063?v=3","gravatar_id":"","url":"https://api.github.com/users/checketts","html_url":"https://github.com/checketts","followers_url":"https://api.github.com/users/checketts/followers","following_url":"https://api.github.com/users/checketts/following{/other_user}","gists_url":"https://api.github.com/users/checketts/gists{/gist_id}","starred_url":"https://api.github.com/users/checketts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/checketts/subscriptions","organizations_url":"https://api.github.com/users/checketts/orgs","repos_url":"https://api.github.com/users/checketts/repos","events_url":"https://api.github.com/users/checketts/events{/privacy}","received_events_url":"https://api.github.com/users/checketts/received_events","type":"User","site_admin":false},"repo":{"id":67091813,"name":"client_java","full_name":"checketts/client_java","owner":{"login":"checketts","id":416063,"avatar_url":"https://avatars.githubusercontent.com/u/416063?v=3","gravatar_id":"","url":"https://api.github.com/users/checketts","html_url":"https://github.com/checketts","followers_url":"https://api.github.com/users/checketts/followers","following_url":"https://api.github.com/users/checketts/following{/other_user}","gists_url":"https://api.github.com/users/checketts/gists{/gist_id}","starred_url":"https://api.github.com/users/checketts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/checketts/subscriptions","organizations_url":"https://api.github.com/users/checketts/orgs","repos_url":"https://api.github.com/users/checketts/repos","events_url":"https://api.github.com/users/checketts/events{/privacy}","received_events_url":"https://api.github.com/users/checketts/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/checketts/client_java","description":"Prometheus instrumentation library for JVM applications","fork":true,"url":"https://api.github.com/repos/checketts/client_java","forks_url":"https://api.github.com/repos/checketts/client_java/forks","keys_url":"https://api.github.com/repos/checketts/client_java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/checketts/client_java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/checketts/client_java/teams","hooks_url":"https://api.github.com/repos/checketts/client_java/hooks","issue_events_url":"https://api.github.com/repos/checketts/client_java/issues/events{/number}","events_url":"https://api.github.com/repos/checketts/client_java/events","assignees_url":"https://api.github.com/repos/checketts/client_java/assignees{/user}","branches_url":"https://api.github.com/repos/checketts/client_java/branches{/branch}","tags_url":"https://api.github.com/repos/checketts/client_java/tags","blobs_url":"https://api.github.com/repos/checketts/client_java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/checketts/client_java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/checketts/client_java/git/refs{/sha}","trees_url":"https://api.github.com/repos/checketts/client_java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/checketts/client_java/statuses/{sha}","languages_url":"https://api.github.com/repos/checketts/client_java/languages","stargazers_url":"https://api.github.com/repos/checketts/client_java/stargazers","contributors_url":"https://api.github.com/repos/checketts/client_java/contributors","subscribers_url":"https://api.github.com/repos/checketts/client_java/subscribers","subscription_url":"https://api.github.com/repos/checketts/client_java/subscription","commits_url":"https://api.github.com/repos/checketts/client_java/commits{/sha}","git_commits_url":"https://api.github.com/repos/checketts/client_java/git/commits{/sha}","comments_url":"https://api.github.com/repos/checketts/client_java/comments{/number}","issue_comment_url":"https://api.github.com/repos/checketts/client_java/issues/comments{/number}","contents_url":"https://api.github.com/repos/checketts/client_java/contents/{+path}","compare_url":"https://api.github.com/repos/checketts/client_java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/checketts/client_java/merges","archive_url":"https://api.github.com/repos/checketts/client_java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/checketts/client_java/downloads","issues_url":"https://api.github.com/repos/checketts/client_java/issues{/number}","pulls_url":"https://api.github.com/repos/checketts/client_java/pulls{/number}","milestones_url":"https://api.github.com/repos/checketts/client_java/milestones{/number}","notifications_url":"https://api.github.com/repos/checketts/client_java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/checketts/client_java/labels{/name}","releases_url":"https://api.github.com/repos/checketts/client_java/releases{/id}","deployments_url":"https://api.github.com/repos/checketts/client_java/deployments","created_at":"2016-09-01T02:43:30Z","updated_at":"2016-09-01T02:43:32Z","pushed_at":"2016-12-29T07:58:29Z","git_url":"git://github.com/checketts/client_java.git","ssh_url":"git@github.com:checketts/client_java.git","clone_url":"https://github.com/checketts/client_java.git","svn_url":"https://github.com/checketts/client_java","homepage":"","size":1962,"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":"prometheus:master","ref":"master","sha":"c90bf0a83f1951597a3be18a3a07c403cd40c543","user":{"login":"prometheus","id":3380462,"avatar_url":"https://avatars.githubusercontent.com/u/3380462?v=3","gravatar_id":"","url":"https://api.github.com/users/prometheus","html_url":"https://github.com/prometheus","followers_url":"https://api.github.com/users/prometheus/followers","following_url":"https://api.github.com/users/prometheus/following{/other_user}","gists_url":"https://api.github.com/users/prometheus/gists{/gist_id}","starred_url":"https://api.github.com/users/prometheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prometheus/subscriptions","organizations_url":"https://api.github.com/users/prometheus/orgs","repos_url":"https://api.github.com/users/prometheus/repos","events_url":"https://api.github.com/users/prometheus/events{/privacy}","received_events_url":"https://api.github.com/users/prometheus/received_events","type":"Organization","site_admin":false},"repo":{"id":7997879,"name":"client_java","full_name":"prometheus/client_java","owner":{"login":"prometheus","id":3380462,"avatar_url":"https://avatars.githubusercontent.com/u/3380462?v=3","gravatar_id":"","url":"https://api.github.com/users/prometheus","html_url":"https://github.com/prometheus","followers_url":"https://api.github.com/users/prometheus/followers","following_url":"https://api.github.com/users/prometheus/following{/other_user}","gists_url":"https://api.github.com/users/prometheus/gists{/gist_id}","starred_url":"https://api.github.com/users/prometheus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prometheus/subscriptions","organizations_url":"https://api.github.com/users/prometheus/orgs","repos_url":"https://api.github.com/users/prometheus/repos","events_url":"https://api.github.com/users/prometheus/events{/privacy}","received_events_url":"https://api.github.com/users/prometheus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prometheus/client_java","description":"Prometheus instrumentation library for JVM applications","fork":false,"url":"https://api.github.com/repos/prometheus/client_java","forks_url":"https://api.github.com/repos/prometheus/client_java/forks","keys_url":"https://api.github.com/repos/prometheus/client_java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prometheus/client_java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prometheus/client_java/teams","hooks_url":"https://api.github.com/repos/prometheus/client_java/hooks","issue_events_url":"https://api.github.com/repos/prometheus/client_java/issues/events{/number}","events_url":"https://api.github.com/repos/prometheus/client_java/events","assignees_url":"https://api.github.com/repos/prometheus/client_java/assignees{/user}","branches_url":"https://api.github.com/repos/prometheus/client_java/branches{/branch}","tags_url":"https://api.github.com/repos/prometheus/client_java/tags","blobs_url":"https://api.github.com/repos/prometheus/client_java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prometheus/client_java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prometheus/client_java/git/refs{/sha}","trees_url":"https://api.github.com/repos/prometheus/client_java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prometheus/client_java/statuses/{sha}","languages_url":"https://api.github.com/repos/prometheus/client_java/languages","stargazers_url":"https://api.github.com/repos/prometheus/client_java/stargazers","contributors_url":"https://api.github.com/repos/prometheus/client_java/contributors","subscribers_url":"https://api.github.com/repos/prometheus/client_java/subscribers","subscription_url":"https://api.github.com/repos/prometheus/client_java/subscription","commits_url":"https://api.github.com/repos/prometheus/client_java/commits{/sha}","git_commits_url":"https://api.github.com/repos/prometheus/client_java/git/commits{/sha}","comments_url":"https://api.github.com/repos/prometheus/client_java/comments{/number}","issue_comment_url":"https://api.github.com/repos/prometheus/client_java/issues/comments{/number}","contents_url":"https://api.github.com/repos/prometheus/client_java/contents/{+path}","compare_url":"https://api.github.com/repos/prometheus/client_java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prometheus/client_java/merges","archive_url":"https://api.github.com/repos/prometheus/client_java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prometheus/client_java/downloads","issues_url":"https://api.github.com/repos/prometheus/client_java/issues{/number}","pulls_url":"https://api.github.com/repos/prometheus/client_java/pulls{/number}","milestones_url":"https://api.github.com/repos/prometheus/client_java/milestones{/number}","notifications_url":"https://api.github.com/repos/prometheus/client_java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prometheus/client_java/labels{/name}","releases_url":"https://api.github.com/repos/prometheus/client_java/releases{/id}","deployments_url":"https://api.github.com/repos/prometheus/client_java/deployments","created_at":"2013-02-03T22:55:49Z","updated_at":"2016-12-28T12:03:43Z","pushed_at":"2016-12-29T08:11:59Z","git_url":"git://github.com/prometheus/client_java.git","ssh_url":"git@github.com:prometheus/client_java.git","clone_url":"https://github.com/prometheus/client_java.git","svn_url":"https://github.com/prometheus/client_java","homepage":"","size":2319,"stargazers_count":91,"watchers_count":91,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":85,"mirror_url":null,"open_issues_count":13,"forks":85,"open_issues":13,"watchers":91,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prometheus/client_java/pulls/172"},"html":{"href":"https://github.com/prometheus/client_java/pull/172"},"issue":{"href":"https://api.github.com/repos/prometheus/client_java/issues/172"},"comments":{"href":"https://api.github.com/repos/prometheus/client_java/issues/172/comments"},"review_comments":{"href":"https://api.github.com/repos/prometheus/client_java/pulls/172/comments"},"review_comment":{"href":"https://api.github.com/repos/prometheus/client_java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prometheus/client_java/pulls/172/commits"},"statuses":{"href":"https://api.github.com/repos/prometheus/client_java/statuses/2b6c21bbfd41f1fef1a2abf5366401ea7df55a96"}}}}
{"actor":{"display_login":"brian-brazil"}}