{"action":"created","comment":{"url":"https://api.github.com/repos/googlecartographer/cartographer_ros/pulls/comments/199088183","pull_request_review_id":133128443,"id":199088183,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTA4ODE4Mw==","diff_hunk":"@@ -0,0 +1,113 @@\n+/*\n+ * Copyright 2018 The Cartographer Authors\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+#ifndef CARTOGRAPHER_ROS_METRICS_HISTOGRAM_H\n+#define CARTOGRAPHER_ROS_METRICS_HISTOGRAM_H\n+\n+#include <algorithm>\n+#include <map>\n+#include <numeric>\n+#include <vector>\n+\n+#include \"cartographer/common/mutex.h\"\n+#include \"cartographer/metrics/histogram.h\"\n+#include \"cartographer_ros/metrics/internal/counter.h\"\n+#include \"cartographer_ros_msgs/Metric.h\"\n+#include \"glog/logging.h\"\n+\n+namespace cartographer_ros {\n+namespace metrics {\n+\n+constexpr double kInfiniteBoundary = std::numeric_limits<double>::infinity();\n+\n+using BucketBoundaries = ::cartographer::metrics::Histogram::BucketBoundaries;\n+\n+class Histogram : public ::cartographer::metrics::Histogram {\n+ public:\n+  Histogram(const std::map<std::string, std::string>& labels,\n+            const BucketBoundaries& bucket_boundaries)\n+      : labels_(labels),\n+        bucket_boundaries_(bucket_boundaries),\n+        bucket_counts_(bucket_boundaries.size() + 1) {\n+    ::cartographer::common::MutexLocker lock(&mutex_);\n+    CHECK(std::is_sorted(std::begin(bucket_boundaries_),\n+                         std::end(bucket_boundaries_)));\n+  }\n+\n+  Histogram(const BucketBoundaries& bucket_boundaries)\n+      : Histogram({}, bucket_boundaries) {}\n+\n+  void Observe(double value) override {\n+    ::cartographer::common::MutexLocker lock(&mutex_);\n+    auto bucket_index =","path":"cartographer_ros/cartographer_ros/metrics/internal/histogram.h","position":55,"original_position":55,"commit_id":"7c42acd2593e1238462aa3fbd77e6eb7569620fa","original_commit_id":"7c42acd2593e1238462aa3fbd77e6eb7569620fa","user":{"login":"gaschler","id":339437,"node_id":"MDQ6VXNlcjMzOTQzNw==","avatar_url":"https://avatars3.githubusercontent.com/u/339437?v=4","gravatar_id":"","url":"https://api.github.com/users/gaschler","html_url":"https://github.com/gaschler","followers_url":"https://api.github.com/users/gaschler/followers","following_url":"https://api.github.com/users/gaschler/following{/other_user}","gists_url":"https://api.github.com/users/gaschler/gists{/gist_id}","starred_url":"https://api.github.com/users/gaschler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaschler/subscriptions","organizations_url":"https://api.github.com/users/gaschler/orgs","repos_url":"https://api.github.com/users/gaschler/repos","events_url":"https://api.github.com/users/gaschler/events{/privacy}","received_events_url":"https://api.github.com/users/gaschler/received_events","type":"User","site_admin":false},"body":"move this before lock","created_at":"2018-06-29T08:24:55Z","updated_at":"2018-06-29T08:30:26Z","html_url":"https://github.com/googlecartographer/cartographer_ros/pull/906#discussion_r199088183","pull_request_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/pulls/906","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/googlecartographer/cartographer_ros/pulls/comments/199088183"},"html":{"href":"https://github.com/googlecartographer/cartographer_ros/pull/906#discussion_r199088183"},"pull_request":{"href":"https://api.github.com/repos/googlecartographer/cartographer_ros/pulls/906"}}},"pull_request":{"url":"https://api.github.com/repos/googlecartographer/cartographer_ros/pulls/906","id":196208153,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2MjA4MTUz","html_url":"https://github.com/googlecartographer/cartographer_ros/pull/906","diff_url":"https://github.com/googlecartographer/cartographer_ros/pull/906.diff","patch_url":"https://github.com/googlecartographer/cartographer_ros/pull/906.patch","issue_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/issues/906","number":906,"state":"open","locked":false,"title":"Add a monitoring bridge and interface to collect internal metrics.","user":{"login":"MichaelGrupp","id":8985495,"node_id":"MDQ6VXNlcjg5ODU0OTU=","avatar_url":"https://avatars3.githubusercontent.com/u/8985495?v=4","gravatar_id":"","url":"https://api.github.com/users/MichaelGrupp","html_url":"https://github.com/MichaelGrupp","followers_url":"https://api.github.com/users/MichaelGrupp/followers","following_url":"https://api.github.com/users/MichaelGrupp/following{/other_user}","gists_url":"https://api.github.com/users/MichaelGrupp/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaelGrupp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaelGrupp/subscriptions","organizations_url":"https://api.github.com/users/MichaelGrupp/orgs","repos_url":"https://api.github.com/users/MichaelGrupp/repos","events_url":"https://api.github.com/users/MichaelGrupp/events{/privacy}","received_events_url":"https://api.github.com/users/MichaelGrupp/received_events","type":"User","site_admin":false},"body":"Adds a registry that is compatible with libcartographer's internal metrics\r\nand a `/collect_metrics`service that provides all metrics in a ROS message.\r\n\r\nSee the corresponding RFC document.","created_at":"2018-06-20T16:52:17Z","updated_at":"2018-06-29T08:30:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3c7e94c4b499be706c029519be51c1cde60bbe9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":418857802,"node_id":"MDU6TGFiZWw0MTg4NTc4MDI=","url":"https://api.github.com/repos/googlecartographer/cartographer_ros/labels/cla:%20yes","name":"cla: yes","color":"0e8a16","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/pulls/906/commits","review_comments_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/pulls/906/comments","review_comment_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/issues/906/comments","statuses_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/statuses/7c42acd2593e1238462aa3fbd77e6eb7569620fa","head":{"label":"magazino:monitoring-rfc-playground","ref":"monitoring-rfc-playground","sha":"7c42acd2593e1238462aa3fbd77e6eb7569620fa","user":{"login":"magazino","id":18398034,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4Mzk4MDM0","avatar_url":"https://avatars1.githubusercontent.com/u/18398034?v=4","gravatar_id":"","url":"https://api.github.com/users/magazino","html_url":"https://github.com/magazino","followers_url":"https://api.github.com/users/magazino/followers","following_url":"https://api.github.com/users/magazino/following{/other_user}","gists_url":"https://api.github.com/users/magazino/gists{/gist_id}","starred_url":"https://api.github.com/users/magazino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magazino/subscriptions","organizations_url":"https://api.github.com/users/magazino/orgs","repos_url":"https://api.github.com/users/magazino/repos","events_url":"https://api.github.com/users/magazino/events{/privacy}","received_events_url":"https://api.github.com/users/magazino/received_events","type":"Organization","site_admin":false},"repo":{"id":65812950,"node_id":"MDEwOlJlcG9zaXRvcnk2NTgxMjk1MA==","name":"cartographer_ros","full_name":"magazino/cartographer_ros","owner":{"login":"magazino","id":18398034,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4Mzk4MDM0","avatar_url":"https://avatars1.githubusercontent.com/u/18398034?v=4","gravatar_id":"","url":"https://api.github.com/users/magazino","html_url":"https://github.com/magazino","followers_url":"https://api.github.com/users/magazino/followers","following_url":"https://api.github.com/users/magazino/following{/other_user}","gists_url":"https://api.github.com/users/magazino/gists{/gist_id}","starred_url":"https://api.github.com/users/magazino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magazino/subscriptions","organizations_url":"https://api.github.com/users/magazino/orgs","repos_url":"https://api.github.com/users/magazino/repos","events_url":"https://api.github.com/users/magazino/events{/privacy}","received_events_url":"https://api.github.com/users/magazino/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/magazino/cartographer_ros","description":"Provides ROS integration for Cartographer.","fork":true,"url":"https://api.github.com/repos/magazino/cartographer_ros","forks_url":"https://api.github.com/repos/magazino/cartographer_ros/forks","keys_url":"https://api.github.com/repos/magazino/cartographer_ros/keys{/key_id}","collaborators_url":"https://api.github.com/repos/magazino/cartographer_ros/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/magazino/cartographer_ros/teams","hooks_url":"https://api.github.com/repos/magazino/cartographer_ros/hooks","issue_events_url":"https://api.github.com/repos/magazino/cartographer_ros/issues/events{/number}","events_url":"https://api.github.com/repos/magazino/cartographer_ros/events","assignees_url":"https://api.github.com/repos/magazino/cartographer_ros/assignees{/user}","branches_url":"https://api.github.com/repos/magazino/cartographer_ros/branches{/branch}","tags_url":"https://api.github.com/repos/magazino/cartographer_ros/tags","blobs_url":"https://api.github.com/repos/magazino/cartographer_ros/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/magazino/cartographer_ros/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/magazino/cartographer_ros/git/refs{/sha}","trees_url":"https://api.github.com/repos/magazino/cartographer_ros/git/trees{/sha}","statuses_url":"https://api.github.com/repos/magazino/cartographer_ros/statuses/{sha}","languages_url":"https://api.github.com/repos/magazino/cartographer_ros/languages","stargazers_url":"https://api.github.com/repos/magazino/cartographer_ros/stargazers","contributors_url":"https://api.github.com/repos/magazino/cartographer_ros/contributors","subscribers_url":"https://api.github.com/repos/magazino/cartographer_ros/subscribers","subscription_url":"https://api.github.com/repos/magazino/cartographer_ros/subscription","commits_url":"https://api.github.com/repos/magazino/cartographer_ros/commits{/sha}","git_commits_url":"https://api.github.com/repos/magazino/cartographer_ros/git/commits{/sha}","comments_url":"https://api.github.com/repos/magazino/cartographer_ros/comments{/number}","issue_comment_url":"https://api.github.com/repos/magazino/cartographer_ros/issues/comments{/number}","contents_url":"https://api.github.com/repos/magazino/cartographer_ros/contents/{+path}","compare_url":"https://api.github.com/repos/magazino/cartographer_ros/compare/{base}...{head}","merges_url":"https://api.github.com/repos/magazino/cartographer_ros/merges","archive_url":"https://api.github.com/repos/magazino/cartographer_ros/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/magazino/cartographer_ros/downloads","issues_url":"https://api.github.com/repos/magazino/cartographer_ros/issues{/number}","pulls_url":"https://api.github.com/repos/magazino/cartographer_ros/pulls{/number}","milestones_url":"https://api.github.com/repos/magazino/cartographer_ros/milestones{/number}","notifications_url":"https://api.github.com/repos/magazino/cartographer_ros/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/magazino/cartographer_ros/labels{/name}","releases_url":"https://api.github.com/repos/magazino/cartographer_ros/releases{/id}","deployments_url":"https://api.github.com/repos/magazino/cartographer_ros/deployments","created_at":"2016-08-16T10:58:38Z","updated_at":"2018-03-29T13:24:26Z","pushed_at":"2018-06-28T16:20:45Z","git_url":"git://github.com/magazino/cartographer_ros.git","ssh_url":"git@github.com:magazino/cartographer_ros.git","clone_url":"https://github.com/magazino/cartographer_ros.git","svn_url":"https://github.com/magazino/cartographer_ros","homepage":"","size":1310,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"googlecartographer:master","ref":"master","sha":"c560d05d99f16559489fb393f42e53ed469f3870","user":{"login":"googlecartographer","id":20636162,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNjM2MTYy","avatar_url":"https://avatars3.githubusercontent.com/u/20636162?v=4","gravatar_id":"","url":"https://api.github.com/users/googlecartographer","html_url":"https://github.com/googlecartographer","followers_url":"https://api.github.com/users/googlecartographer/followers","following_url":"https://api.github.com/users/googlecartographer/following{/other_user}","gists_url":"https://api.github.com/users/googlecartographer/gists{/gist_id}","starred_url":"https://api.github.com/users/googlecartographer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googlecartographer/subscriptions","organizations_url":"https://api.github.com/users/googlecartographer/orgs","repos_url":"https://api.github.com/users/googlecartographer/repos","events_url":"https://api.github.com/users/googlecartographer/events{/privacy}","received_events_url":"https://api.github.com/users/googlecartographer/received_events","type":"Organization","site_admin":false},"repo":{"id":64838142,"node_id":"MDEwOlJlcG9zaXRvcnk2NDgzODE0Mg==","name":"cartographer_ros","full_name":"googlecartographer/cartographer_ros","owner":{"login":"googlecartographer","id":20636162,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNjM2MTYy","avatar_url":"https://avatars3.githubusercontent.com/u/20636162?v=4","gravatar_id":"","url":"https://api.github.com/users/googlecartographer","html_url":"https://github.com/googlecartographer","followers_url":"https://api.github.com/users/googlecartographer/followers","following_url":"https://api.github.com/users/googlecartographer/following{/other_user}","gists_url":"https://api.github.com/users/googlecartographer/gists{/gist_id}","starred_url":"https://api.github.com/users/googlecartographer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googlecartographer/subscriptions","organizations_url":"https://api.github.com/users/googlecartographer/orgs","repos_url":"https://api.github.com/users/googlecartographer/repos","events_url":"https://api.github.com/users/googlecartographer/events{/privacy}","received_events_url":"https://api.github.com/users/googlecartographer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/googlecartographer/cartographer_ros","description":"Provides ROS integration for Cartographer.","fork":false,"url":"https://api.github.com/repos/googlecartographer/cartographer_ros","forks_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/forks","keys_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/teams","hooks_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/hooks","issue_events_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/issues/events{/number}","events_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/events","assignees_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/assignees{/user}","branches_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/branches{/branch}","tags_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/tags","blobs_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/git/refs{/sha}","trees_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/statuses/{sha}","languages_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/languages","stargazers_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/stargazers","contributors_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/contributors","subscribers_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/subscribers","subscription_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/subscription","commits_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/commits{/sha}","git_commits_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/git/commits{/sha}","comments_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/comments{/number}","issue_comment_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/issues/comments{/number}","contents_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/contents/{+path}","compare_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/merges","archive_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/downloads","issues_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/issues{/number}","pulls_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/pulls{/number}","milestones_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/milestones{/number}","notifications_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/labels{/name}","releases_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/releases{/id}","deployments_url":"https://api.github.com/repos/googlecartographer/cartographer_ros/deployments","created_at":"2016-08-03T10:43:23Z","updated_at":"2018-06-27T02:01:00Z","pushed_at":"2018-06-28T16:20:46Z","git_url":"git://github.com/googlecartographer/cartographer_ros.git","ssh_url":"git@github.com:googlecartographer/cartographer_ros.git","clone_url":"https://github.com/googlecartographer/cartographer_ros.git","svn_url":"https://github.com/googlecartographer/cartographer_ros","homepage":"","size":1129,"stargazers_count":564,"watchers_count":564,"language":"C++","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":449,"mirror_url":null,"archived":false,"open_issues_count":56,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":449,"open_issues":56,"watchers":564,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/googlecartographer/cartographer_ros/pulls/906"},"html":{"href":"https://github.com/googlecartographer/cartographer_ros/pull/906"},"issue":{"href":"https://api.github.com/repos/googlecartographer/cartographer_ros/issues/906"},"comments":{"href":"https://api.github.com/repos/googlecartographer/cartographer_ros/issues/906/comments"},"review_comments":{"href":"https://api.github.com/repos/googlecartographer/cartographer_ros/pulls/906/comments"},"review_comment":{"href":"https://api.github.com/repos/googlecartographer/cartographer_ros/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googlecartographer/cartographer_ros/pulls/906/commits"},"statuses":{"href":"https://api.github.com/repos/googlecartographer/cartographer_ros/statuses/7c42acd2593e1238462aa3fbd77e6eb7569620fa"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"gaschler"}}