{"action":"created","comment":{"url":"https://api.github.com/repos/kiali/kiali-ui/pulls/comments/191786734","pull_request_review_id":124427932,"id":191786734,"diff_hunk":"@@ -44,25 +44,31 @@ export default class RpsChart extends React.Component<RpsChartTypeProp, {}> {\n     let len = dataRps.length;\n     let minRps: number = len > 1 ? +dataRps[1] : 0;\n     let maxRps: number = len > 1 ? +dataRps[1] : 0;\n-    let sumRps: number = 0;\n     for (let i = 2; i < len; ++i) {\n       let sample: number = +dataRps[i];\n       minRps = sample < minRps ? sample : minRps;\n       maxRps = sample > maxRps ? sample : maxRps;\n-      sumRps += +sample;\n     }\n-    const avgRps = len < 2 ? 0 : sumRps / (len - 1);\n \n-    len = dataErrors.length;\n-    let minErr: number = len > 1 ? +dataErrors[1] : 0;\n-    let maxErr: number = len > 1 ? +dataErrors[1] : 0;\n-    for (let i = 2; i < len; ++i) {\n-      let sample: number = +dataErrors[i];\n-      minErr = sample < minErr ? sample : minErr;\n-      maxErr = sample > maxErr ? sample : maxErr;\n+    let pctMinErr: number = 0;\n+    let pctMaxErr: number = 0;\n+    if (dataErrors.length > 0 && dataErrors.length !== dataRps.length) {\n+      // We should be getting the same sized arrays for both; if not, something is wrong.\n+      // We won't blow up, but we'll show NaN to indicate a problem.\n+      pctMinErr = NaN;\n+      pctMaxErr = NaN;\n+    } else {\n+      len = dataErrors.length;\n+      if (len > 1) {\n+        pctMinErr = dataRps[0] && !isNaN(dataRps[0]) ? +dataErrors[0] / +dataRps[0] * 100 : 0;\n+        pctMaxErr = dataRps[0] && !isNaN(dataRps[0]) ? +dataErrors[0] / +dataRps[0] * 100 : 0;\n+        for (let i = 1; i < len; ++i) {\n+          let sample: number = dataRps[i] && !isNaN(dataRps[i]) ? +dataErrors[i] / +dataRps[i] * 100 : 0;\n+          pctMinErr = sample < pctMinErr ? sample : pctMinErr;\n+          pctMaxErr = sample > pctMaxErr ? sample : pctMaxErr;\n+        }\n+      }\n     }\n-    const pctMinErr = avgRps === 0 ? 0 : minErr / avgRps * 100;\n-    const pctMaxErr = avgRps === 0 ? 0 : maxErr / avgRps * 100;","path":"src/components/SummaryPanel/RpsChart.tsx","position":40,"original_position":40,"commit_id":"b307e0f840bb4e93f76196d53d11fa778e2ea2f5","original_commit_id":"b307e0f840bb4e93f76196d53d11fa778e2ea2f5","user":{"login":"jmazzitelli","id":2029470,"avatar_url":"https://avatars0.githubusercontent.com/u/2029470?v=4","gravatar_id":"","url":"https://api.github.com/users/jmazzitelli","html_url":"https://github.com/jmazzitelli","followers_url":"https://api.github.com/users/jmazzitelli/followers","following_url":"https://api.github.com/users/jmazzitelli/following{/other_user}","gists_url":"https://api.github.com/users/jmazzitelli/gists{/gist_id}","starred_url":"https://api.github.com/users/jmazzitelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmazzitelli/subscriptions","organizations_url":"https://api.github.com/users/jmazzitelli/orgs","repos_url":"https://api.github.com/users/jmazzitelli/repos","events_url":"https://api.github.com/users/jmazzitelli/events{/privacy}","received_events_url":"https://api.github.com/users/jmazzitelli/received_events","type":"User","site_admin":false},"body":"Yes, that was the major issue I had to fix.","created_at":"2018-05-30T14:21:33Z","updated_at":"2018-05-30T14:21:33Z","html_url":"https://github.com/kiali/kiali-ui/pull/376#discussion_r191786734","pull_request_url":"https://api.github.com/repos/kiali/kiali-ui/pulls/376","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/kiali/kiali-ui/pulls/comments/191786734"},"html":{"href":"https://github.com/kiali/kiali-ui/pull/376#discussion_r191786734"},"pull_request":{"href":"https://api.github.com/repos/kiali/kiali-ui/pulls/376"}},"in_reply_to_id":191777889},"pull_request":{"url":"https://api.github.com/repos/kiali/kiali-ui/pulls/376","id":191270022,"html_url":"https://github.com/kiali/kiali-ui/pull/376","diff_url":"https://github.com/kiali/kiali-ui/pull/376.diff","patch_url":"https://github.com/kiali/kiali-ui/pull/376.patch","issue_url":"https://api.github.com/repos/kiali/kiali-ui/issues/376","number":376,"state":"open","locked":false,"title":"KIALI-649 sparkline calculations for the error min/max values","user":{"login":"jmazzitelli","id":2029470,"avatar_url":"https://avatars0.githubusercontent.com/u/2029470?v=4","gravatar_id":"","url":"https://api.github.com/users/jmazzitelli","html_url":"https://github.com/jmazzitelli","followers_url":"https://api.github.com/users/jmazzitelli/followers","following_url":"https://api.github.com/users/jmazzitelli/following{/other_user}","gists_url":"https://api.github.com/users/jmazzitelli/gists{/gist_id}","starred_url":"https://api.github.com/users/jmazzitelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmazzitelli/subscriptions","organizations_url":"https://api.github.com/users/jmazzitelli/orgs","repos_url":"https://api.github.com/users/jmazzitelli/repos","events_url":"https://api.github.com/users/jmazzitelli/events{/privacy}","received_events_url":"https://api.github.com/users/jmazzitelli/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-29T21:05:27Z","updated_at":"2018-05-30T14:21:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b6dfb7546f5a0c3ba12d97a90bc3414414da95e2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":843835097,"url":"https://api.github.com/repos/kiali/kiali-ui/labels/Do%20NOT%20Merge%20(yet)","name":"Do NOT Merge (yet)","color":"5ed694","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kiali/kiali-ui/pulls/376/commits","review_comments_url":"https://api.github.com/repos/kiali/kiali-ui/pulls/376/comments","review_comment_url":"https://api.github.com/repos/kiali/kiali-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kiali/kiali-ui/issues/376/comments","statuses_url":"https://api.github.com/repos/kiali/kiali-ui/statuses/b307e0f840bb4e93f76196d53d11fa778e2ea2f5","head":{"label":"jmazzitelli:KIALI-649-sparkline-error-min-max","ref":"KIALI-649-sparkline-error-min-max","sha":"b307e0f840bb4e93f76196d53d11fa778e2ea2f5","user":{"login":"jmazzitelli","id":2029470,"avatar_url":"https://avatars0.githubusercontent.com/u/2029470?v=4","gravatar_id":"","url":"https://api.github.com/users/jmazzitelli","html_url":"https://github.com/jmazzitelli","followers_url":"https://api.github.com/users/jmazzitelli/followers","following_url":"https://api.github.com/users/jmazzitelli/following{/other_user}","gists_url":"https://api.github.com/users/jmazzitelli/gists{/gist_id}","starred_url":"https://api.github.com/users/jmazzitelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmazzitelli/subscriptions","organizations_url":"https://api.github.com/users/jmazzitelli/orgs","repos_url":"https://api.github.com/users/jmazzitelli/repos","events_url":"https://api.github.com/users/jmazzitelli/events{/privacy}","received_events_url":"https://api.github.com/users/jmazzitelli/received_events","type":"User","site_admin":false},"repo":{"id":126534412,"name":"kiali-ui","full_name":"jmazzitelli/kiali-ui","owner":{"login":"jmazzitelli","id":2029470,"avatar_url":"https://avatars0.githubusercontent.com/u/2029470?v=4","gravatar_id":"","url":"https://api.github.com/users/jmazzitelli","html_url":"https://github.com/jmazzitelli","followers_url":"https://api.github.com/users/jmazzitelli/followers","following_url":"https://api.github.com/users/jmazzitelli/following{/other_user}","gists_url":"https://api.github.com/users/jmazzitelli/gists{/gist_id}","starred_url":"https://api.github.com/users/jmazzitelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmazzitelli/subscriptions","organizations_url":"https://api.github.com/users/jmazzitelli/orgs","repos_url":"https://api.github.com/users/jmazzitelli/repos","events_url":"https://api.github.com/users/jmazzitelli/events{/privacy}","received_events_url":"https://api.github.com/users/jmazzitelli/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmazzitelli/kiali-ui","description":null,"fork":true,"url":"https://api.github.com/repos/jmazzitelli/kiali-ui","forks_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/forks","keys_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/teams","hooks_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/hooks","issue_events_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/issues/events{/number}","events_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/events","assignees_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/assignees{/user}","branches_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/branches{/branch}","tags_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/tags","blobs_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/languages","stargazers_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/stargazers","contributors_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/contributors","subscribers_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/subscribers","subscription_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/subscription","commits_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/contents/{+path}","compare_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/merges","archive_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/downloads","issues_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/issues{/number}","pulls_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/labels{/name}","releases_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/releases{/id}","deployments_url":"https://api.github.com/repos/jmazzitelli/kiali-ui/deployments","created_at":"2018-03-23T20:13:04Z","updated_at":"2018-03-23T20:13:07Z","pushed_at":"2018-05-30T13:55:01Z","git_url":"git://github.com/jmazzitelli/kiali-ui.git","ssh_url":"git@github.com:jmazzitelli/kiali-ui.git","clone_url":"https://github.com/jmazzitelli/kiali-ui.git","svn_url":"https://github.com/jmazzitelli/kiali-ui","homepage":null,"size":1847,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","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":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kiali:master","ref":"master","sha":"7c8092724466a478577ec6d04cbd9c320e7472fb","user":{"login":"kiali","id":36001875,"avatar_url":"https://avatars2.githubusercontent.com/u/36001875?v=4","gravatar_id":"","url":"https://api.github.com/users/kiali","html_url":"https://github.com/kiali","followers_url":"https://api.github.com/users/kiali/followers","following_url":"https://api.github.com/users/kiali/following{/other_user}","gists_url":"https://api.github.com/users/kiali/gists{/gist_id}","starred_url":"https://api.github.com/users/kiali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiali/subscriptions","organizations_url":"https://api.github.com/users/kiali/orgs","repos_url":"https://api.github.com/users/kiali/repos","events_url":"https://api.github.com/users/kiali/events{/privacy}","received_events_url":"https://api.github.com/users/kiali/received_events","type":"Organization","site_admin":false},"repo":{"id":120308264,"name":"kiali-ui","full_name":"kiali/kiali-ui","owner":{"login":"kiali","id":36001875,"avatar_url":"https://avatars2.githubusercontent.com/u/36001875?v=4","gravatar_id":"","url":"https://api.github.com/users/kiali","html_url":"https://github.com/kiali","followers_url":"https://api.github.com/users/kiali/followers","following_url":"https://api.github.com/users/kiali/following{/other_user}","gists_url":"https://api.github.com/users/kiali/gists{/gist_id}","starred_url":"https://api.github.com/users/kiali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiali/subscriptions","organizations_url":"https://api.github.com/users/kiali/orgs","repos_url":"https://api.github.com/users/kiali/repos","events_url":"https://api.github.com/users/kiali/events{/privacy}","received_events_url":"https://api.github.com/users/kiali/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kiali/kiali-ui","description":"Frontend part of Kiali","fork":false,"url":"https://api.github.com/repos/kiali/kiali-ui","forks_url":"https://api.github.com/repos/kiali/kiali-ui/forks","keys_url":"https://api.github.com/repos/kiali/kiali-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kiali/kiali-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kiali/kiali-ui/teams","hooks_url":"https://api.github.com/repos/kiali/kiali-ui/hooks","issue_events_url":"https://api.github.com/repos/kiali/kiali-ui/issues/events{/number}","events_url":"https://api.github.com/repos/kiali/kiali-ui/events","assignees_url":"https://api.github.com/repos/kiali/kiali-ui/assignees{/user}","branches_url":"https://api.github.com/repos/kiali/kiali-ui/branches{/branch}","tags_url":"https://api.github.com/repos/kiali/kiali-ui/tags","blobs_url":"https://api.github.com/repos/kiali/kiali-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kiali/kiali-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kiali/kiali-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/kiali/kiali-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kiali/kiali-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/kiali/kiali-ui/languages","stargazers_url":"https://api.github.com/repos/kiali/kiali-ui/stargazers","contributors_url":"https://api.github.com/repos/kiali/kiali-ui/contributors","subscribers_url":"https://api.github.com/repos/kiali/kiali-ui/subscribers","subscription_url":"https://api.github.com/repos/kiali/kiali-ui/subscription","commits_url":"https://api.github.com/repos/kiali/kiali-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/kiali/kiali-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/kiali/kiali-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/kiali/kiali-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/kiali/kiali-ui/contents/{+path}","compare_url":"https://api.github.com/repos/kiali/kiali-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kiali/kiali-ui/merges","archive_url":"https://api.github.com/repos/kiali/kiali-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kiali/kiali-ui/downloads","issues_url":"https://api.github.com/repos/kiali/kiali-ui/issues{/number}","pulls_url":"https://api.github.com/repos/kiali/kiali-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/kiali/kiali-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/kiali/kiali-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kiali/kiali-ui/labels{/name}","releases_url":"https://api.github.com/repos/kiali/kiali-ui/releases{/id}","deployments_url":"https://api.github.com/repos/kiali/kiali-ui/deployments","created_at":"2018-02-05T13:27:15Z","updated_at":"2018-05-30T11:19:30Z","pushed_at":"2018-05-30T14:18:03Z","git_url":"git://github.com/kiali/kiali-ui.git","ssh_url":"git@github.com:kiali/kiali-ui.git","clone_url":"https://github.com/kiali/kiali-ui.git","svn_url":"https://github.com/kiali/kiali-ui","homepage":"","size":1847,"stargazers_count":24,"watchers_count":24,"language":"TypeScript","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":17,"mirror_url":null,"archived":false,"open_issues_count":16,"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":17,"open_issues":16,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kiali/kiali-ui/pulls/376"},"html":{"href":"https://github.com/kiali/kiali-ui/pull/376"},"issue":{"href":"https://api.github.com/repos/kiali/kiali-ui/issues/376"},"comments":{"href":"https://api.github.com/repos/kiali/kiali-ui/issues/376/comments"},"review_comments":{"href":"https://api.github.com/repos/kiali/kiali-ui/pulls/376/comments"},"review_comment":{"href":"https://api.github.com/repos/kiali/kiali-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kiali/kiali-ui/pulls/376/commits"},"statuses":{"href":"https://api.github.com/repos/kiali/kiali-ui/statuses/b307e0f840bb4e93f76196d53d11fa778e2ea2f5"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jmazzitelli"}}