{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/kibana/pulls/comments/228756603","pull_request_review_id":169100726,"id":228756603,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODc1NjYwMw==","diff_hunk":"@@ -52,3 +52,14 @@ export function asInteger(value) {\n export function tpmUnit(type) {\n   return type === 'request' ? 'rpm' : 'tpm';\n }\n+\n+export function getDurationPercent(\n+  itemDuration: number,\n+  totalDuration?: number,\n+  fallbackResult?: string\n+) {\n+  if (totalDuration === undefined || totalDuration === 0) {\n+    return fallbackResult || '';","path":"x-pack/plugins/apm/public/utils/formatters.js","position":11,"original_position":11,"commit_id":"577610e7c4ca0512a0e814fe8f5ede5483a824a0","original_commit_id":"577610e7c4ca0512a0e814fe8f5ede5483a824a0","user":{"login":"jasonrhodes","id":159370,"node_id":"MDQ6VXNlcjE1OTM3MA==","avatar_url":"https://avatars0.githubusercontent.com/u/159370?v=4","gravatar_id":"","url":"https://api.github.com/users/jasonrhodes","html_url":"https://github.com/jasonrhodes","followers_url":"https://api.github.com/users/jasonrhodes/followers","following_url":"https://api.github.com/users/jasonrhodes/following{/other_user}","gists_url":"https://api.github.com/users/jasonrhodes/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonrhodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonrhodes/subscriptions","organizations_url":"https://api.github.com/users/jasonrhodes/orgs","repos_url":"https://api.github.com/users/jasonrhodes/repos","events_url":"https://api.github.com/users/jasonrhodes/events{/privacy}","received_events_url":"https://api.github.com/users/jasonrhodes/received_events","type":"User","site_admin":false},"body":"If we use a default prop for `fallbackResult` in the arguments list and default it to `''`, we won't have to worry about if the caller wants to fall back to `0` or `null` or something here.","created_at":"2018-10-28T17:08:32Z","updated_at":"2018-10-28T17:08:32Z","html_url":"https://github.com/elastic/kibana/pull/24675#discussion_r228756603","pull_request_url":"https://api.github.com/repos/elastic/kibana/pulls/24675","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments/228756603"},"html":{"href":"https://github.com/elastic/kibana/pull/24675#discussion_r228756603"},"pull_request":{"href":"https://api.github.com/repos/elastic/kibana/pulls/24675"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/kibana/pulls/24675","id":226187898,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2MTg3ODk4","html_url":"https://github.com/elastic/kibana/pull/24675","diff_url":"https://github.com/elastic/kibana/pull/24675.diff","patch_url":"https://github.com/elastic/kibana/pull/24675.patch","issue_url":"https://api.github.com/repos/elastic/kibana/issues/24675","number":24675,"state":"open","locked":false,"title":"[APM] Fix divide by 0 bug in percentage duration","user":{"login":"ogupte","id":1967266,"node_id":"MDQ6VXNlcjE5NjcyNjY=","avatar_url":"https://avatars2.githubusercontent.com/u/1967266?v=4","gravatar_id":"","url":"https://api.github.com/users/ogupte","html_url":"https://github.com/ogupte","followers_url":"https://api.github.com/users/ogupte/followers","following_url":"https://api.github.com/users/ogupte/following{/other_user}","gists_url":"https://api.github.com/users/ogupte/gists{/gist_id}","starred_url":"https://api.github.com/users/ogupte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogupte/subscriptions","organizations_url":"https://api.github.com/users/ogupte/orgs","repos_url":"https://api.github.com/users/ogupte/repos","events_url":"https://api.github.com/users/ogupte/events{/privacy}","received_events_url":"https://api.github.com/users/ogupte/received_events","type":"User","site_admin":false},"body":"Fixes #24532\r\n\r\n## Summary\r\nConsolidates logic where total duration could be 0 and handling it with a fallback value.\r\n\r\n### Checklist\r\n\r\n- ~~This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~\r\n- ~~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~~\r\n- ~~[Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~~\r\n- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios\r\n- ~~This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~~\r\n\r\n### For maintainers\r\n\r\n- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)\r\n- [ ] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)\r\n\r\n","created_at":"2018-10-26T18:31:07Z","updated_at":"2018-10-28T17:08:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"190e6fa491a6c85b0b694a55a95bb3349474a79c","assignee":{"login":"ogupte","id":1967266,"node_id":"MDQ6VXNlcjE5NjcyNjY=","avatar_url":"https://avatars2.githubusercontent.com/u/1967266?v=4","gravatar_id":"","url":"https://api.github.com/users/ogupte","html_url":"https://github.com/ogupte","followers_url":"https://api.github.com/users/ogupte/followers","following_url":"https://api.github.com/users/ogupte/following{/other_user}","gists_url":"https://api.github.com/users/ogupte/gists{/gist_id}","starred_url":"https://api.github.com/users/ogupte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogupte/subscriptions","organizations_url":"https://api.github.com/users/ogupte/orgs","repos_url":"https://api.github.com/users/ogupte/repos","events_url":"https://api.github.com/users/ogupte/events{/privacy}","received_events_url":"https://api.github.com/users/ogupte/received_events","type":"User","site_admin":false},"assignees":[{"login":"ogupte","id":1967266,"node_id":"MDQ6VXNlcjE5NjcyNjY=","avatar_url":"https://avatars2.githubusercontent.com/u/1967266?v=4","gravatar_id":"","url":"https://api.github.com/users/ogupte","html_url":"https://github.com/ogupte","followers_url":"https://api.github.com/users/ogupte/followers","following_url":"https://api.github.com/users/ogupte/following{/other_user}","gists_url":"https://api.github.com/users/ogupte/gists{/gist_id}","starred_url":"https://api.github.com/users/ogupte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogupte/subscriptions","organizations_url":"https://api.github.com/users/ogupte/orgs","repos_url":"https://api.github.com/users/ogupte/repos","events_url":"https://api.github.com/users/ogupte/events{/privacy}","received_events_url":"https://api.github.com/users/ogupte/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"sqren","id":209966,"node_id":"MDQ6VXNlcjIwOTk2Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/209966?v=4","gravatar_id":"","url":"https://api.github.com/users/sqren","html_url":"https://github.com/sqren","followers_url":"https://api.github.com/users/sqren/followers","following_url":"https://api.github.com/users/sqren/following{/other_user}","gists_url":"https://api.github.com/users/sqren/gists{/gist_id}","starred_url":"https://api.github.com/users/sqren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sqren/subscriptions","organizations_url":"https://api.github.com/users/sqren/orgs","repos_url":"https://api.github.com/users/sqren/repos","events_url":"https://api.github.com/users/sqren/events{/privacy}","received_events_url":"https://api.github.com/users/sqren/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/kibana/pulls/24675/commits","review_comments_url":"https://api.github.com/repos/elastic/kibana/pulls/24675/comments","review_comment_url":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/24675/comments","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/577610e7c4ca0512a0e814fe8f5ede5483a824a0","head":{"label":"ogupte:apm-40165-duration-divide-by-0-fix","ref":"apm-40165-duration-divide-by-0-fix","sha":"577610e7c4ca0512a0e814fe8f5ede5483a824a0","user":{"login":"ogupte","id":1967266,"node_id":"MDQ6VXNlcjE5NjcyNjY=","avatar_url":"https://avatars2.githubusercontent.com/u/1967266?v=4","gravatar_id":"","url":"https://api.github.com/users/ogupte","html_url":"https://github.com/ogupte","followers_url":"https://api.github.com/users/ogupte/followers","following_url":"https://api.github.com/users/ogupte/following{/other_user}","gists_url":"https://api.github.com/users/ogupte/gists{/gist_id}","starred_url":"https://api.github.com/users/ogupte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogupte/subscriptions","organizations_url":"https://api.github.com/users/ogupte/orgs","repos_url":"https://api.github.com/users/ogupte/repos","events_url":"https://api.github.com/users/ogupte/events{/privacy}","received_events_url":"https://api.github.com/users/ogupte/received_events","type":"User","site_admin":false},"repo":{"id":150627167,"node_id":"MDEwOlJlcG9zaXRvcnkxNTA2MjcxNjc=","name":"kibana","full_name":"ogupte/kibana","private":false,"owner":{"login":"ogupte","id":1967266,"node_id":"MDQ6VXNlcjE5NjcyNjY=","avatar_url":"https://avatars2.githubusercontent.com/u/1967266?v=4","gravatar_id":"","url":"https://api.github.com/users/ogupte","html_url":"https://github.com/ogupte","followers_url":"https://api.github.com/users/ogupte/followers","following_url":"https://api.github.com/users/ogupte/following{/other_user}","gists_url":"https://api.github.com/users/ogupte/gists{/gist_id}","starred_url":"https://api.github.com/users/ogupte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogupte/subscriptions","organizations_url":"https://api.github.com/users/ogupte/orgs","repos_url":"https://api.github.com/users/ogupte/repos","events_url":"https://api.github.com/users/ogupte/events{/privacy}","received_events_url":"https://api.github.com/users/ogupte/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ogupte/kibana","description":":bar_chart: Kibana analytics and search dashboard for Elasticsearch","fork":true,"url":"https://api.github.com/repos/ogupte/kibana","forks_url":"https://api.github.com/repos/ogupte/kibana/forks","keys_url":"https://api.github.com/repos/ogupte/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ogupte/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ogupte/kibana/teams","hooks_url":"https://api.github.com/repos/ogupte/kibana/hooks","issue_events_url":"https://api.github.com/repos/ogupte/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/ogupte/kibana/events","assignees_url":"https://api.github.com/repos/ogupte/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/ogupte/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/ogupte/kibana/tags","blobs_url":"https://api.github.com/repos/ogupte/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ogupte/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ogupte/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/ogupte/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ogupte/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/ogupte/kibana/languages","stargazers_url":"https://api.github.com/repos/ogupte/kibana/stargazers","contributors_url":"https://api.github.com/repos/ogupte/kibana/contributors","subscribers_url":"https://api.github.com/repos/ogupte/kibana/subscribers","subscription_url":"https://api.github.com/repos/ogupte/kibana/subscription","commits_url":"https://api.github.com/repos/ogupte/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/ogupte/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/ogupte/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/ogupte/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/ogupte/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/ogupte/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ogupte/kibana/merges","archive_url":"https://api.github.com/repos/ogupte/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ogupte/kibana/downloads","issues_url":"https://api.github.com/repos/ogupte/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/ogupte/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/ogupte/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/ogupte/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ogupte/kibana/labels{/name}","releases_url":"https://api.github.com/repos/ogupte/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/ogupte/kibana/deployments","created_at":"2018-09-27T17:55:59Z","updated_at":"2018-10-26T19:06:52Z","pushed_at":"2018-10-26T19:16:56Z","git_url":"git://github.com/ogupte/kibana.git","ssh_url":"git@github.com:ogupte/kibana.git","clone_url":"https://github.com/ogupte/kibana.git","svn_url":"https://github.com/ogupte/kibana","homepage":"https://www.elastic.co/products/kibana","size":488065,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"b093fddee8650af1b2cc83500b8a0d9f601961e1","user":{"login":"elastic","id":6764390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NjQzOTA=","avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":7833168,"node_id":"MDEwOlJlcG9zaXRvcnk3ODMzMTY4","name":"kibana","full_name":"elastic/kibana","private":false,"owner":{"login":"elastic","id":6764390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NjQzOTA=","avatar_url":"https://avatars0.githubusercontent.com/u/6764390?v=4","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/elastic/kibana","description":":bar_chart: Kibana analytics and search dashboard for Elasticsearch","fork":false,"url":"https://api.github.com/repos/elastic/kibana","forks_url":"https://api.github.com/repos/elastic/kibana/forks","keys_url":"https://api.github.com/repos/elastic/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/kibana/teams","hooks_url":"https://api.github.com/repos/elastic/kibana/hooks","issue_events_url":"https://api.github.com/repos/elastic/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/kibana/events","assignees_url":"https://api.github.com/repos/elastic/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/kibana/tags","blobs_url":"https://api.github.com/repos/elastic/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/kibana/languages","stargazers_url":"https://api.github.com/repos/elastic/kibana/stargazers","contributors_url":"https://api.github.com/repos/elastic/kibana/contributors","subscribers_url":"https://api.github.com/repos/elastic/kibana/subscribers","subscription_url":"https://api.github.com/repos/elastic/kibana/subscription","commits_url":"https://api.github.com/repos/elastic/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/kibana/merges","archive_url":"https://api.github.com/repos/elastic/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/kibana/downloads","issues_url":"https://api.github.com/repos/elastic/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/kibana/labels{/name}","releases_url":"https://api.github.com/repos/elastic/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/kibana/deployments","created_at":"2013-01-26T04:00:59Z","updated_at":"2018-10-28T13:43:18Z","pushed_at":"2018-10-28T15:34:32Z","git_url":"git://github.com/elastic/kibana.git","ssh_url":"git@github.com:elastic/kibana.git","clone_url":"https://github.com/elastic/kibana.git","svn_url":"https://github.com/elastic/kibana","homepage":"https://www.elastic.co/products/kibana","size":556491,"stargazers_count":10329,"watchers_count":10329,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4014,"mirror_url":null,"archived":false,"open_issues_count":3611,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":4014,"open_issues":3611,"watchers":10329,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/24675"},"html":{"href":"https://github.com/elastic/kibana/pull/24675"},"issue":{"href":"https://api.github.com/repos/elastic/kibana/issues/24675"},"comments":{"href":"https://api.github.com/repos/elastic/kibana/issues/24675/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/kibana/pulls/24675/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/kibana/pulls/24675/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/kibana/statuses/577610e7c4ca0512a0e814fe8f5ede5483a824a0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jasonrhodes"}}