{"action":"created","comment":{"url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/comments/166931593","pull_request_review_id":95070063,"id":166931593,"diff_hunk":"@@ -259,6 +293,47 @@ export class DeploymentsService implements OnDestroy {\n       );\n   }\n \n+  getDeploymentTimeConstrainedStats(spaceId: string, applicationId: string, environmentName: string, elapsedTime: number, endTime: number = Date.now()): Observable<TimeConstrainedStats> {\n+    const startTime = endTime - elapsedTime;\n+    const series = this.getTimeConstrainedTimeseriesData(spaceId, applicationId, environmentName, startTime, endTime);\n+    // Process CPU Stats\n+    const coresSeries: Observable<CoresSeries[]> = series.map((t: MultiTimeseriesData) => t.cores);\n+    const cpuQuota = this.getEnvironmentCpuStat(spaceId, environmentName).map((stat: CpuStat) => stat.quota);\n+    let cpuStats = Observable.combineLatest(coresSeries, cpuQuota, (coresSeries: CoresSeries[], cpuQuota: number) => {\n+      let arr = [];\n+      for (let i = 0; i < coresSeries.length; i++) {","path":"src/app/space/create/deployments/services/deployments.service.ts","position":60,"original_position":60,"commit_id":"16c0871c630fa096c0719172c9eb3f248d577260","original_commit_id":"16c0871c630fa096c0719172c9eb3f248d577260","user":{"login":"andrewazores","id":3787464,"avatar_url":"https://avatars0.githubusercontent.com/u/3787464?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewazores","html_url":"https://github.com/andrewazores","followers_url":"https://api.github.com/users/andrewazores/followers","following_url":"https://api.github.com/users/andrewazores/following{/other_user}","gists_url":"https://api.github.com/users/andrewazores/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewazores/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewazores/subscriptions","organizations_url":"https://api.github.com/users/andrewazores/orgs","repos_url":"https://api.github.com/users/andrewazores/repos","events_url":"https://api.github.com/users/andrewazores/events{/privacy}","received_events_url":"https://api.github.com/users/andrewazores/received_events","type":"User","site_admin":false},"body":"He's looping over an array emitted by an Observable, but it is a little confusing because the name is shadowed.","created_at":"2018-02-08T13:25:26Z","updated_at":"2018-02-08T13:25:26Z","html_url":"https://github.com/fabric8-ui/fabric8-ui/pull/2504#discussion_r166931593","pull_request_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/2504","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/comments/166931593"},"html":{"href":"https://github.com/fabric8-ui/fabric8-ui/pull/2504#discussion_r166931593"},"pull_request":{"href":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/2504"}},"in_reply_to_id":166820427},"pull_request":{"url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/2504","id":167507700,"html_url":"https://github.com/fabric8-ui/fabric8-ui/pull/2504","diff_url":"https://github.com/fabric8-ui/fabric8-ui/pull/2504.diff","patch_url":"https://github.com/fabric8-ui/fabric8-ui/pull/2504.patch","issue_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/issues/2504","number":2504,"state":"open","locked":false,"title":"feat(deployments): deployments charts display last fifteen minutes of…","user":{"login":"aptmac","id":10425301,"avatar_url":"https://avatars2.githubusercontent.com/u/10425301?v=4","gravatar_id":"","url":"https://api.github.com/users/aptmac","html_url":"https://github.com/aptmac","followers_url":"https://api.github.com/users/aptmac/followers","following_url":"https://api.github.com/users/aptmac/following{/other_user}","gists_url":"https://api.github.com/users/aptmac/gists{/gist_id}","starred_url":"https://api.github.com/users/aptmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aptmac/subscriptions","organizations_url":"https://api.github.com/users/aptmac/orgs","repos_url":"https://api.github.com/users/aptmac/repos","events_url":"https://api.github.com/users/aptmac/events{/privacy}","received_events_url":"https://api.github.com/users/aptmac/received_events","type":"User","site_admin":false},"body":"… data on initialization\r\n\r\nThis PR addresses [openshift.io issue 2038](https://github.com/openshiftio/openshift.io/issues/2038)[0], and introduces functionality to retrieve the last 15 minutes worth of deployments chart data when the charts are initialized. The data is retrieved by using the statseries API, and specifying a start and end time. \r\n\r\nIn deployments.service.ts, getTimeConstrainedTimeseriesData() is a private function that gets the response from the API using a start and end time, and getDeploymentTimeConstrainedStats() is the public function that cleans and returns information to the component. The timestamps corresponding to the time constrained data are retained in response to [todo comments](https://github.com/aptmac/fabric8-ui/blob/master/src/app/space/create/deployments/services/deployments.service.ts#L236), and are propagated to the component (but not currently used). \r\n\r\nIn deployment-details.component.ts, the initial stats are requested and processed prior to the polling of cpu/memory/network data in ngOnInit().\r\n\r\nThere are included unit tests that check the functionality of:\r\n- the component asking for the last 15 minutes worth of data\r\n- the component including the cpu, memory, and network data prior to the later polled data\r\n- the service handling an empty statseries response\r\n- the service correctly combining quota and statseries responses\r\n\r\nHere's an image of what the charts look like on creation currently:\r\n![before](https://user-images.githubusercontent.com/10425301/35878575-b9f773ea-0b46-11e8-83c1-aaf5d472a880.png)\r\n\r\nAnd here's what they look like with this patch applied:\r\n![charts-after](https://user-images.githubusercontent.com/10425301/35878568-b3a3c192-0b46-11e8-9a4d-1eca4432355d.png)\r\n\r\n[0] https://github.com/openshiftio/openshift.io/issues/2038\r\n[1] https://github.com/aptmac/fabric8-ui/blob/master/src/app/space/create/deployments/services/deployments.service.ts#L236","created_at":"2018-02-06T19:28:26Z","updated_at":"2018-02-08T13:25:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c2fea44f87eb8503210318ba6d77a5a02af7e473","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/2504/commits","review_comments_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/2504/comments","review_comment_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/issues/2504/comments","statuses_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/statuses/16c0871c630fa096c0719172c9eb3f248d577260","head":{"label":"aptmac:pr-charts-load-fifteen-min","ref":"pr-charts-load-fifteen-min","sha":"16c0871c630fa096c0719172c9eb3f248d577260","user":{"login":"aptmac","id":10425301,"avatar_url":"https://avatars2.githubusercontent.com/u/10425301?v=4","gravatar_id":"","url":"https://api.github.com/users/aptmac","html_url":"https://github.com/aptmac","followers_url":"https://api.github.com/users/aptmac/followers","following_url":"https://api.github.com/users/aptmac/following{/other_user}","gists_url":"https://api.github.com/users/aptmac/gists{/gist_id}","starred_url":"https://api.github.com/users/aptmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aptmac/subscriptions","organizations_url":"https://api.github.com/users/aptmac/orgs","repos_url":"https://api.github.com/users/aptmac/repos","events_url":"https://api.github.com/users/aptmac/events{/privacy}","received_events_url":"https://api.github.com/users/aptmac/received_events","type":"User","site_admin":false},"repo":{"id":117593075,"name":"fabric8-ui","full_name":"aptmac/fabric8-ui","owner":{"login":"aptmac","id":10425301,"avatar_url":"https://avatars2.githubusercontent.com/u/10425301?v=4","gravatar_id":"","url":"https://api.github.com/users/aptmac","html_url":"https://github.com/aptmac","followers_url":"https://api.github.com/users/aptmac/followers","following_url":"https://api.github.com/users/aptmac/following{/other_user}","gists_url":"https://api.github.com/users/aptmac/gists{/gist_id}","starred_url":"https://api.github.com/users/aptmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aptmac/subscriptions","organizations_url":"https://api.github.com/users/aptmac/orgs","repos_url":"https://api.github.com/users/aptmac/repos","events_url":"https://api.github.com/users/aptmac/events{/privacy}","received_events_url":"https://api.github.com/users/aptmac/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aptmac/fabric8-ui","description":"The Angular frontend for fabric8 online (OpenShift.IO)","fork":true,"url":"https://api.github.com/repos/aptmac/fabric8-ui","forks_url":"https://api.github.com/repos/aptmac/fabric8-ui/forks","keys_url":"https://api.github.com/repos/aptmac/fabric8-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aptmac/fabric8-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aptmac/fabric8-ui/teams","hooks_url":"https://api.github.com/repos/aptmac/fabric8-ui/hooks","issue_events_url":"https://api.github.com/repos/aptmac/fabric8-ui/issues/events{/number}","events_url":"https://api.github.com/repos/aptmac/fabric8-ui/events","assignees_url":"https://api.github.com/repos/aptmac/fabric8-ui/assignees{/user}","branches_url":"https://api.github.com/repos/aptmac/fabric8-ui/branches{/branch}","tags_url":"https://api.github.com/repos/aptmac/fabric8-ui/tags","blobs_url":"https://api.github.com/repos/aptmac/fabric8-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aptmac/fabric8-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aptmac/fabric8-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/aptmac/fabric8-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aptmac/fabric8-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/aptmac/fabric8-ui/languages","stargazers_url":"https://api.github.com/repos/aptmac/fabric8-ui/stargazers","contributors_url":"https://api.github.com/repos/aptmac/fabric8-ui/contributors","subscribers_url":"https://api.github.com/repos/aptmac/fabric8-ui/subscribers","subscription_url":"https://api.github.com/repos/aptmac/fabric8-ui/subscription","commits_url":"https://api.github.com/repos/aptmac/fabric8-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/aptmac/fabric8-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/aptmac/fabric8-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/aptmac/fabric8-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/aptmac/fabric8-ui/contents/{+path}","compare_url":"https://api.github.com/repos/aptmac/fabric8-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aptmac/fabric8-ui/merges","archive_url":"https://api.github.com/repos/aptmac/fabric8-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aptmac/fabric8-ui/downloads","issues_url":"https://api.github.com/repos/aptmac/fabric8-ui/issues{/number}","pulls_url":"https://api.github.com/repos/aptmac/fabric8-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/aptmac/fabric8-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/aptmac/fabric8-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aptmac/fabric8-ui/labels{/name}","releases_url":"https://api.github.com/repos/aptmac/fabric8-ui/releases{/id}","deployments_url":"https://api.github.com/repos/aptmac/fabric8-ui/deployments","created_at":"2018-01-15T20:39:35Z","updated_at":"2018-01-15T20:39:39Z","pushed_at":"2018-02-07T21:04:40Z","git_url":"git://github.com/aptmac/fabric8-ui.git","ssh_url":"git@github.com:aptmac/fabric8-ui.git","clone_url":"https://github.com/aptmac/fabric8-ui.git","svn_url":"https://github.com/aptmac/fabric8-ui","homepage":"https://openshift.io/","size":10689,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fabric8-ui:master","ref":"master","sha":"6b8f01cbf1430a4bce7e663c92d253131f0a2341","user":{"login":"fabric8-ui","id":25244298,"avatar_url":"https://avatars2.githubusercontent.com/u/25244298?v=4","gravatar_id":"","url":"https://api.github.com/users/fabric8-ui","html_url":"https://github.com/fabric8-ui","followers_url":"https://api.github.com/users/fabric8-ui/followers","following_url":"https://api.github.com/users/fabric8-ui/following{/other_user}","gists_url":"https://api.github.com/users/fabric8-ui/gists{/gist_id}","starred_url":"https://api.github.com/users/fabric8-ui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabric8-ui/subscriptions","organizations_url":"https://api.github.com/users/fabric8-ui/orgs","repos_url":"https://api.github.com/users/fabric8-ui/repos","events_url":"https://api.github.com/users/fabric8-ui/events{/privacy}","received_events_url":"https://api.github.com/users/fabric8-ui/received_events","type":"Organization","site_admin":false},"repo":{"id":73824736,"name":"fabric8-ui","full_name":"fabric8-ui/fabric8-ui","owner":{"login":"fabric8-ui","id":25244298,"avatar_url":"https://avatars2.githubusercontent.com/u/25244298?v=4","gravatar_id":"","url":"https://api.github.com/users/fabric8-ui","html_url":"https://github.com/fabric8-ui","followers_url":"https://api.github.com/users/fabric8-ui/followers","following_url":"https://api.github.com/users/fabric8-ui/following{/other_user}","gists_url":"https://api.github.com/users/fabric8-ui/gists{/gist_id}","starred_url":"https://api.github.com/users/fabric8-ui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabric8-ui/subscriptions","organizations_url":"https://api.github.com/users/fabric8-ui/orgs","repos_url":"https://api.github.com/users/fabric8-ui/repos","events_url":"https://api.github.com/users/fabric8-ui/events{/privacy}","received_events_url":"https://api.github.com/users/fabric8-ui/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fabric8-ui/fabric8-ui","description":"The Angular frontend for fabric8 online (OpenShift.IO)","fork":false,"url":"https://api.github.com/repos/fabric8-ui/fabric8-ui","forks_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/forks","keys_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/teams","hooks_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/hooks","issue_events_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/issues/events{/number}","events_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/events","assignees_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/assignees{/user}","branches_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/branches{/branch}","tags_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/tags","blobs_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/languages","stargazers_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/stargazers","contributors_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/contributors","subscribers_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/subscribers","subscription_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/subscription","commits_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/contents/{+path}","compare_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/merges","archive_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/downloads","issues_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/issues{/number}","pulls_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/labels{/name}","releases_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/releases{/id}","deployments_url":"https://api.github.com/repos/fabric8-ui/fabric8-ui/deployments","created_at":"2016-11-15T15:04:11Z","updated_at":"2018-02-01T06:28:23Z","pushed_at":"2018-02-08T08:59:17Z","git_url":"git://github.com/fabric8-ui/fabric8-ui.git","ssh_url":"git@github.com:fabric8-ui/fabric8-ui.git","clone_url":"https://github.com/fabric8-ui/fabric8-ui.git","svn_url":"https://github.com/fabric8-ui/fabric8-ui","homepage":"https://openshift.io/","size":10665,"stargazers_count":20,"watchers_count":20,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":68,"mirror_url":null,"archived":false,"open_issues_count":20,"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":68,"open_issues":20,"watchers":20,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/2504"},"html":{"href":"https://github.com/fabric8-ui/fabric8-ui/pull/2504"},"issue":{"href":"https://api.github.com/repos/fabric8-ui/fabric8-ui/issues/2504"},"comments":{"href":"https://api.github.com/repos/fabric8-ui/fabric8-ui/issues/2504/comments"},"review_comments":{"href":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/2504/comments"},"review_comment":{"href":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fabric8-ui/fabric8-ui/pulls/2504/commits"},"statuses":{"href":"https://api.github.com/repos/fabric8-ui/fabric8-ui/statuses/16c0871c630fa096c0719172c9eb3f248d577260"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"andrewazores"}}