{"action":"created","comment":{"url":"https://api.github.com/repos/envoyproxy/envoy/pulls/comments/178593642","pull_request_review_id":108671506,"id":178593642,"diff_hunk":"@@ -333,27 +340,50 @@ class GaugeImpl : public Gauge, public MetricImpl {\n   // Stats::Gauge\n   virtual void add(uint64_t amount) override {\n     data_.value_ += amount;\n-    data_.flags_ |= RawStatData::Flags::Used;\n+    data_.flags_ |= Flags::Used;\n   }\n   virtual void dec() override { sub(1); }\n   virtual void inc() override { add(1); }\n   virtual void set(uint64_t value) override {\n     data_.value_ = value;\n-    data_.flags_ |= RawStatData::Flags::Used;\n+    data_.flags_ |= Flags::Used;\n   }\n   virtual void sub(uint64_t amount) override {\n     ASSERT(data_.value_ >= amount);\n     ASSERT(used());\n     data_.value_ -= amount;\n   }\n   virtual uint64_t value() const override { return data_.value_; }\n-  bool used() const override { return data_.flags_ & RawStatData::Flags::Used; }\n+  bool used() const override { return data_.flags_ & Flags::Used; }\n \n private:\n   RawStatData& data_;\n   RawStatDataAllocator& alloc_;\n };\n \n+/**\n+ * Structure to hold statistical data of histogram.\n+ */\n+struct HistogramStatistics {\n+public:\n+  HistogramStatistics() {}\n+\n+  HistogramStatistics(histogram_t* histogram_ptr) {\n+    hist_approx_quantile(histogram_ptr, const_cast<double*>(quantiles_in_),\n+                         ARRAY_SIZE(quantiles_in_), quantiles_out_);\n+  }\n+\n+  std::string summary() const {\n+    return fmt::format(\"P0: {} , P25: {}, P50: {}, P75: {}, P90: {}, P95: {}, P99: {}, P100: {}\",\n+                       quantiles_out_[0], quantiles_out_[1], quantiles_out_[2], quantiles_out_[3],\n+                       quantiles_out_[4], quantiles_out_[5], quantiles_out_[6], quantiles_out_[7],\n+                       quantiles_out_[8]);\n+  }\n+\n+  double quantiles_in_[9] = {0, 0.25, 0.5, 0.75, 0.90, 0.95, 0.99, 0.999, 1};","path":"source/common/stats/stats_impl.h","position":97,"original_position":97,"commit_id":"08cc211fcf7d52d7d89c87e4e1cd8af587deae15","original_commit_id":"08cc211fcf7d52d7d89c87e4e1cd8af587deae15","user":{"login":"mattklein123","id":6305260,"avatar_url":"https://avatars3.githubusercontent.com/u/6305260?v=4","gravatar_id":"","url":"https://api.github.com/users/mattklein123","html_url":"https://github.com/mattklein123","followers_url":"https://api.github.com/users/mattklein123/followers","following_url":"https://api.github.com/users/mattklein123/following{/other_user}","gists_url":"https://api.github.com/users/mattklein123/gists{/gist_id}","starred_url":"https://api.github.com/users/mattklein123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattklein123/subscriptions","organizations_url":"https://api.github.com/users/mattklein123/orgs","repos_url":"https://api.github.com/users/mattklein123/repos","events_url":"https://api.github.com/users/mattklein123/events{/privacy}","received_events_url":"https://api.github.com/users/mattklein123/received_events","type":"User","site_admin":false},"body":"These should all be static constants. If you can't figure out how to do the C++ I think either @mrice32 or @jmarantz can hopefully help.","created_at":"2018-04-02T17:16:07Z","updated_at":"2018-04-02T17:30:18Z","html_url":"https://github.com/envoyproxy/envoy/pull/2932#discussion_r178593642","pull_request_url":"https://api.github.com/repos/envoyproxy/envoy/pulls/2932","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/envoyproxy/envoy/pulls/comments/178593642"},"html":{"href":"https://github.com/envoyproxy/envoy/pull/2932#discussion_r178593642"},"pull_request":{"href":"https://api.github.com/repos/envoyproxy/envoy/pulls/2932"}}},"pull_request":{"url":"https://api.github.com/repos/envoyproxy/envoy/pulls/2932","id":178316465,"html_url":"https://github.com/envoyproxy/envoy/pull/2932","diff_url":"https://github.com/envoyproxy/envoy/pull/2932.diff","patch_url":"https://github.com/envoyproxy/envoy/pull/2932.patch","issue_url":"https://api.github.com/repos/envoyproxy/envoy/issues/2932","number":2932,"state":"open","locked":false,"title":"[WIP] stats: add built-in log linear histogram support","user":{"login":"ramaraochavali","id":17204904,"avatar_url":"https://avatars0.githubusercontent.com/u/17204904?v=4","gravatar_id":"","url":"https://api.github.com/users/ramaraochavali","html_url":"https://github.com/ramaraochavali","followers_url":"https://api.github.com/users/ramaraochavali/followers","following_url":"https://api.github.com/users/ramaraochavali/following{/other_user}","gists_url":"https://api.github.com/users/ramaraochavali/gists{/gist_id}","starred_url":"https://api.github.com/users/ramaraochavali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramaraochavali/subscriptions","organizations_url":"https://api.github.com/users/ramaraochavali/orgs","repos_url":"https://api.github.com/users/ramaraochavali/repos","events_url":"https://api.github.com/users/ramaraochavali/events{/privacy}","received_events_url":"https://api.github.com/users/ramaraochavali/received_events","type":"User","site_admin":false},"body":"*Description*:\r\nImplements built-in log linear histogram. Fixes the issue https://github.com/envoyproxy/envoy/issues/1965\r\n\r\n*Risk Level*: High\r\n\r\n*Testing*:\r\nUnit, Integration and Manual testing.\r\n\r\n*Docs Changes*:\r\nNA\r\n\r\n*Release Notes*:\r\n\r\n","created_at":"2018-03-29T12:40:15Z","updated_at":"2018-04-02T17:30:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"81888d15f9aed132d1cc1d43d5d8b3c98376ec21","assignee":{"login":"jmarantz","id":1942589,"avatar_url":"https://avatars3.githubusercontent.com/u/1942589?v=4","gravatar_id":"","url":"https://api.github.com/users/jmarantz","html_url":"https://github.com/jmarantz","followers_url":"https://api.github.com/users/jmarantz/followers","following_url":"https://api.github.com/users/jmarantz/following{/other_user}","gists_url":"https://api.github.com/users/jmarantz/gists{/gist_id}","starred_url":"https://api.github.com/users/jmarantz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmarantz/subscriptions","organizations_url":"https://api.github.com/users/jmarantz/orgs","repos_url":"https://api.github.com/users/jmarantz/repos","events_url":"https://api.github.com/users/jmarantz/events{/privacy}","received_events_url":"https://api.github.com/users/jmarantz/received_events","type":"User","site_admin":false},"assignees":[{"login":"jmarantz","id":1942589,"avatar_url":"https://avatars3.githubusercontent.com/u/1942589?v=4","gravatar_id":"","url":"https://api.github.com/users/jmarantz","html_url":"https://github.com/jmarantz","followers_url":"https://api.github.com/users/jmarantz/followers","following_url":"https://api.github.com/users/jmarantz/following{/other_user}","gists_url":"https://api.github.com/users/jmarantz/gists{/gist_id}","starred_url":"https://api.github.com/users/jmarantz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmarantz/subscriptions","organizations_url":"https://api.github.com/users/jmarantz/orgs","repos_url":"https://api.github.com/users/jmarantz/repos","events_url":"https://api.github.com/users/jmarantz/events{/privacy}","received_events_url":"https://api.github.com/users/jmarantz/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/envoyproxy/envoy/pulls/2932/commits","review_comments_url":"https://api.github.com/repos/envoyproxy/envoy/pulls/2932/comments","review_comment_url":"https://api.github.com/repos/envoyproxy/envoy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/envoyproxy/envoy/issues/2932/comments","statuses_url":"https://api.github.com/repos/envoyproxy/envoy/statuses/08cc211fcf7d52d7d89c87e4e1cd8af587deae15","head":{"label":"ramaraochavali:feature/native_loglinear_hist","ref":"feature/native_loglinear_hist","sha":"08cc211fcf7d52d7d89c87e4e1cd8af587deae15","user":{"login":"ramaraochavali","id":17204904,"avatar_url":"https://avatars0.githubusercontent.com/u/17204904?v=4","gravatar_id":"","url":"https://api.github.com/users/ramaraochavali","html_url":"https://github.com/ramaraochavali","followers_url":"https://api.github.com/users/ramaraochavali/followers","following_url":"https://api.github.com/users/ramaraochavali/following{/other_user}","gists_url":"https://api.github.com/users/ramaraochavali/gists{/gist_id}","starred_url":"https://api.github.com/users/ramaraochavali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramaraochavali/subscriptions","organizations_url":"https://api.github.com/users/ramaraochavali/orgs","repos_url":"https://api.github.com/users/ramaraochavali/repos","events_url":"https://api.github.com/users/ramaraochavali/events{/privacy}","received_events_url":"https://api.github.com/users/ramaraochavali/received_events","type":"User","site_admin":false},"repo":{"id":107149436,"name":"envoy","full_name":"ramaraochavali/envoy","owner":{"login":"ramaraochavali","id":17204904,"avatar_url":"https://avatars0.githubusercontent.com/u/17204904?v=4","gravatar_id":"","url":"https://api.github.com/users/ramaraochavali","html_url":"https://github.com/ramaraochavali","followers_url":"https://api.github.com/users/ramaraochavali/followers","following_url":"https://api.github.com/users/ramaraochavali/following{/other_user}","gists_url":"https://api.github.com/users/ramaraochavali/gists{/gist_id}","starred_url":"https://api.github.com/users/ramaraochavali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramaraochavali/subscriptions","organizations_url":"https://api.github.com/users/ramaraochavali/orgs","repos_url":"https://api.github.com/users/ramaraochavali/repos","events_url":"https://api.github.com/users/ramaraochavali/events{/privacy}","received_events_url":"https://api.github.com/users/ramaraochavali/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ramaraochavali/envoy","description":"C++ front/service proxy","fork":true,"url":"https://api.github.com/repos/ramaraochavali/envoy","forks_url":"https://api.github.com/repos/ramaraochavali/envoy/forks","keys_url":"https://api.github.com/repos/ramaraochavali/envoy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ramaraochavali/envoy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ramaraochavali/envoy/teams","hooks_url":"https://api.github.com/repos/ramaraochavali/envoy/hooks","issue_events_url":"https://api.github.com/repos/ramaraochavali/envoy/issues/events{/number}","events_url":"https://api.github.com/repos/ramaraochavali/envoy/events","assignees_url":"https://api.github.com/repos/ramaraochavali/envoy/assignees{/user}","branches_url":"https://api.github.com/repos/ramaraochavali/envoy/branches{/branch}","tags_url":"https://api.github.com/repos/ramaraochavali/envoy/tags","blobs_url":"https://api.github.com/repos/ramaraochavali/envoy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ramaraochavali/envoy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ramaraochavali/envoy/git/refs{/sha}","trees_url":"https://api.github.com/repos/ramaraochavali/envoy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ramaraochavali/envoy/statuses/{sha}","languages_url":"https://api.github.com/repos/ramaraochavali/envoy/languages","stargazers_url":"https://api.github.com/repos/ramaraochavali/envoy/stargazers","contributors_url":"https://api.github.com/repos/ramaraochavali/envoy/contributors","subscribers_url":"https://api.github.com/repos/ramaraochavali/envoy/subscribers","subscription_url":"https://api.github.com/repos/ramaraochavali/envoy/subscription","commits_url":"https://api.github.com/repos/ramaraochavali/envoy/commits{/sha}","git_commits_url":"https://api.github.com/repos/ramaraochavali/envoy/git/commits{/sha}","comments_url":"https://api.github.com/repos/ramaraochavali/envoy/comments{/number}","issue_comment_url":"https://api.github.com/repos/ramaraochavali/envoy/issues/comments{/number}","contents_url":"https://api.github.com/repos/ramaraochavali/envoy/contents/{+path}","compare_url":"https://api.github.com/repos/ramaraochavali/envoy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ramaraochavali/envoy/merges","archive_url":"https://api.github.com/repos/ramaraochavali/envoy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ramaraochavali/envoy/downloads","issues_url":"https://api.github.com/repos/ramaraochavali/envoy/issues{/number}","pulls_url":"https://api.github.com/repos/ramaraochavali/envoy/pulls{/number}","milestones_url":"https://api.github.com/repos/ramaraochavali/envoy/milestones{/number}","notifications_url":"https://api.github.com/repos/ramaraochavali/envoy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ramaraochavali/envoy/labels{/name}","releases_url":"https://api.github.com/repos/ramaraochavali/envoy/releases{/id}","deployments_url":"https://api.github.com/repos/ramaraochavali/envoy/deployments","created_at":"2017-10-16T15:50:10Z","updated_at":"2018-03-28T06:22:07Z","pushed_at":"2018-04-02T07:01:46Z","git_url":"git://github.com/ramaraochavali/envoy.git","ssh_url":"git@github.com:ramaraochavali/envoy.git","clone_url":"https://github.com/ramaraochavali/envoy.git","svn_url":"https://github.com/ramaraochavali/envoy","homepage":"https://envoyproxy.github.io/","size":53264,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"envoyproxy:master","ref":"master","sha":"5fcc829e7800a77ea2703a1ead3f25915aae6d61","user":{"login":"envoyproxy","id":30125649,"avatar_url":"https://avatars1.githubusercontent.com/u/30125649?v=4","gravatar_id":"","url":"https://api.github.com/users/envoyproxy","html_url":"https://github.com/envoyproxy","followers_url":"https://api.github.com/users/envoyproxy/followers","following_url":"https://api.github.com/users/envoyproxy/following{/other_user}","gists_url":"https://api.github.com/users/envoyproxy/gists{/gist_id}","starred_url":"https://api.github.com/users/envoyproxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/envoyproxy/subscriptions","organizations_url":"https://api.github.com/users/envoyproxy/orgs","repos_url":"https://api.github.com/users/envoyproxy/repos","events_url":"https://api.github.com/users/envoyproxy/events{/privacy}","received_events_url":"https://api.github.com/users/envoyproxy/received_events","type":"Organization","site_admin":false},"repo":{"id":65214191,"name":"envoy","full_name":"envoyproxy/envoy","owner":{"login":"envoyproxy","id":30125649,"avatar_url":"https://avatars1.githubusercontent.com/u/30125649?v=4","gravatar_id":"","url":"https://api.github.com/users/envoyproxy","html_url":"https://github.com/envoyproxy","followers_url":"https://api.github.com/users/envoyproxy/followers","following_url":"https://api.github.com/users/envoyproxy/following{/other_user}","gists_url":"https://api.github.com/users/envoyproxy/gists{/gist_id}","starred_url":"https://api.github.com/users/envoyproxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/envoyproxy/subscriptions","organizations_url":"https://api.github.com/users/envoyproxy/orgs","repos_url":"https://api.github.com/users/envoyproxy/repos","events_url":"https://api.github.com/users/envoyproxy/events{/privacy}","received_events_url":"https://api.github.com/users/envoyproxy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/envoyproxy/envoy","description":"C++ front/service proxy","fork":false,"url":"https://api.github.com/repos/envoyproxy/envoy","forks_url":"https://api.github.com/repos/envoyproxy/envoy/forks","keys_url":"https://api.github.com/repos/envoyproxy/envoy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/envoyproxy/envoy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/envoyproxy/envoy/teams","hooks_url":"https://api.github.com/repos/envoyproxy/envoy/hooks","issue_events_url":"https://api.github.com/repos/envoyproxy/envoy/issues/events{/number}","events_url":"https://api.github.com/repos/envoyproxy/envoy/events","assignees_url":"https://api.github.com/repos/envoyproxy/envoy/assignees{/user}","branches_url":"https://api.github.com/repos/envoyproxy/envoy/branches{/branch}","tags_url":"https://api.github.com/repos/envoyproxy/envoy/tags","blobs_url":"https://api.github.com/repos/envoyproxy/envoy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/envoyproxy/envoy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/envoyproxy/envoy/git/refs{/sha}","trees_url":"https://api.github.com/repos/envoyproxy/envoy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/envoyproxy/envoy/statuses/{sha}","languages_url":"https://api.github.com/repos/envoyproxy/envoy/languages","stargazers_url":"https://api.github.com/repos/envoyproxy/envoy/stargazers","contributors_url":"https://api.github.com/repos/envoyproxy/envoy/contributors","subscribers_url":"https://api.github.com/repos/envoyproxy/envoy/subscribers","subscription_url":"https://api.github.com/repos/envoyproxy/envoy/subscription","commits_url":"https://api.github.com/repos/envoyproxy/envoy/commits{/sha}","git_commits_url":"https://api.github.com/repos/envoyproxy/envoy/git/commits{/sha}","comments_url":"https://api.github.com/repos/envoyproxy/envoy/comments{/number}","issue_comment_url":"https://api.github.com/repos/envoyproxy/envoy/issues/comments{/number}","contents_url":"https://api.github.com/repos/envoyproxy/envoy/contents/{+path}","compare_url":"https://api.github.com/repos/envoyproxy/envoy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/envoyproxy/envoy/merges","archive_url":"https://api.github.com/repos/envoyproxy/envoy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/envoyproxy/envoy/downloads","issues_url":"https://api.github.com/repos/envoyproxy/envoy/issues{/number}","pulls_url":"https://api.github.com/repos/envoyproxy/envoy/pulls{/number}","milestones_url":"https://api.github.com/repos/envoyproxy/envoy/milestones{/number}","notifications_url":"https://api.github.com/repos/envoyproxy/envoy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/envoyproxy/envoy/labels{/name}","releases_url":"https://api.github.com/repos/envoyproxy/envoy/releases{/id}","deployments_url":"https://api.github.com/repos/envoyproxy/envoy/deployments","created_at":"2016-08-08T15:07:24Z","updated_at":"2018-04-02T17:00:44Z","pushed_at":"2018-04-02T17:04:01Z","git_url":"git://github.com/envoyproxy/envoy.git","ssh_url":"git@github.com:envoyproxy/envoy.git","clone_url":"https://github.com/envoyproxy/envoy.git","svn_url":"https://github.com/envoyproxy/envoy","homepage":"https://envoyproxy.github.io/","size":13506,"stargazers_count":4404,"watchers_count":4404,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":539,"mirror_url":null,"archived":false,"open_issues_count":294,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":539,"open_issues":294,"watchers":4404,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/envoyproxy/envoy/pulls/2932"},"html":{"href":"https://github.com/envoyproxy/envoy/pull/2932"},"issue":{"href":"https://api.github.com/repos/envoyproxy/envoy/issues/2932"},"comments":{"href":"https://api.github.com/repos/envoyproxy/envoy/issues/2932/comments"},"review_comments":{"href":"https://api.github.com/repos/envoyproxy/envoy/pulls/2932/comments"},"review_comment":{"href":"https://api.github.com/repos/envoyproxy/envoy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/envoyproxy/envoy/pulls/2932/commits"},"statuses":{"href":"https://api.github.com/repos/envoyproxy/envoy/statuses/08cc211fcf7d52d7d89c87e4e1cd8af587deae15"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mattklein123"}}