{"action":"created","issue":{"url":"https://api.github.com/repos/dcos/dcos-ui/issues/3305","repository_url":"https://api.github.com/repos/dcos/dcos-ui","labels_url":"https://api.github.com/repos/dcos/dcos-ui/issues/3305/labels{/name}","comments_url":"https://api.github.com/repos/dcos/dcos-ui/issues/3305/comments","events_url":"https://api.github.com/repos/dcos/dcos-ui/issues/3305/events","html_url":"https://github.com/dcos/dcos-ui/pull/3305","id":361987416,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2ODIyMjI4","number":3305,"title":"DCOS-42230: Clarify resource totals on pod instances table","user":{"login":"natmegs","id":19582796,"node_id":"MDQ6VXNlcjE5NTgyNzk2","avatar_url":"https://avatars1.githubusercontent.com/u/19582796?v=4","gravatar_id":"","url":"https://api.github.com/users/natmegs","html_url":"https://github.com/natmegs","followers_url":"https://api.github.com/users/natmegs/followers","following_url":"https://api.github.com/users/natmegs/following{/other_user}","gists_url":"https://api.github.com/users/natmegs/gists{/gist_id}","starred_url":"https://api.github.com/users/natmegs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natmegs/subscriptions","organizations_url":"https://api.github.com/users/natmegs/orgs","repos_url":"https://api.github.com/users/natmegs/repos","events_url":"https://api.github.com/users/natmegs/events{/privacy}","received_events_url":"https://api.github.com/users/natmegs/received_events","type":"User","site_admin":false},"labels":[{"id":757181847,"node_id":"MDU6TGFiZWw3NTcxODE4NDc=","url":"https://api.github.com/repos/dcos/dcos-ui/labels/work%20in%20progress","name":"work in progress","color":"097ec6","default":false}],"state":"open","locked":false,"assignee":{"login":"nLight","id":186223,"node_id":"MDQ6VXNlcjE4NjIyMw==","avatar_url":"https://avatars0.githubusercontent.com/u/186223?v=4","gravatar_id":"","url":"https://api.github.com/users/nLight","html_url":"https://github.com/nLight","followers_url":"https://api.github.com/users/nLight/followers","following_url":"https://api.github.com/users/nLight/following{/other_user}","gists_url":"https://api.github.com/users/nLight/gists{/gist_id}","starred_url":"https://api.github.com/users/nLight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nLight/subscriptions","organizations_url":"https://api.github.com/users/nLight/orgs","repos_url":"https://api.github.com/users/nLight/repos","events_url":"https://api.github.com/users/nLight/events{/privacy}","received_events_url":"https://api.github.com/users/nLight/received_events","type":"User","site_admin":false},"assignees":[{"login":"nLight","id":186223,"node_id":"MDQ6VXNlcjE4NjIyMw==","avatar_url":"https://avatars0.githubusercontent.com/u/186223?v=4","gravatar_id":"","url":"https://api.github.com/users/nLight","html_url":"https://github.com/nLight","followers_url":"https://api.github.com/users/nLight/followers","following_url":"https://api.github.com/users/nLight/following{/other_user}","gists_url":"https://api.github.com/users/nLight/gists{/gist_id}","starred_url":"https://api.github.com/users/nLight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nLight/subscriptions","organizations_url":"https://api.github.com/users/nLight/orgs","repos_url":"https://api.github.com/users/nLight/repos","events_url":"https://api.github.com/users/nLight/events{/privacy}","received_events_url":"https://api.github.com/users/nLight/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-09-20T01:46:44Z","updated_at":"2018-09-20T11:53:35Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/dcos/dcos-ui/pulls/3305","html_url":"https://github.com/dcos/dcos-ui/pull/3305","diff_url":"https://github.com/dcos/dcos-ui/pull/3305.diff","patch_url":"https://github.com/dcos/dcos-ui/pull/3305.patch"},"body":"Clarify to users what the breakdown of the resources is on the pod instances table.\r\n\r\nAdded tooltips to the resource cells in the PodInstancesTable. If it is an expandable row (has child containers), it gives a breakdown of the resource summary as \"Containers: X, Executor: Y\". If is a non-expandable row (child container), it indicates how much of the allocated resource is being used as \"Using X/Y\".\r\n\r\nCloses DCOS-42230.\r\n\r\n## Testing\r\n\r\n- Run a service from JSON config which can be found in [JIRA ticket comment](https://jira.mesosphere.com/browse/DCOS-17436?focusedCommentId=174971&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-174971). \r\n- Go to services, click on the service you just started, hover over the resource cells on the parent (expandable) row. They should give breakdown of resources being used by containers and executor resources. \r\n- Expand the instance row. Hover again over the resource cells in the rows. They should indicate what the container is using compared to what's allocated. (Using this config, when the task is complete, the used resources should be 0).\r\n\r\n## Trade-offs\r\n\r\nMany. Some background:\r\n\r\nHistorical instances and pod instances are merged together in the `PodInstancesContainer` (via the `PodUtil` `mergeHistoricalInstanceList`), and the `PodInstancesTable` receives this merged instance list eventually as a prop. If a task in a container has completed, it will be in both the pod instance list and historical instance list. When the containers are merged together, if there are two containers with the same containerId, only one is kept in the merged list. The container from the pod instance list has NO resources listed since it is not using resources. The matching container from the historical instance list HAS resources listed to represent the available (not used) resources for that container. So when we keep only one (the match from the historical instance list), there is a resources property on that container.\r\n\r\nThis is inconsistent with how non-completed tasks are represented, since the resources property on these objects represents the resources in use (not resources available). This discrepancy makes it difficult to determine when the resources property is indicating resources that are available or resources that are in use by a container.\r\n\r\nTo alleviate the problem, I added an `activeResources` property to the containers to indicate which resources are in use. If there are NO historical instances (no completed tasks), the `activeResources` will simply be a copy of the regular resources property. If there ARE historical instances, when they are merged, we look at the pod instance match and if there is no resources property on this object, we add an empty `activeResources` object to the container to indicate that there are no resources being used.\r\n\r\nSummary: having access to the `activeResources` depends currently on calling `mergeHistoricalInstanceList` (which always happens now in `PodInstancesContainer` but is not enforced at the `PodInstancesTable` component). Adding `activeResources` changes the \"shape\" of the pod instances list.\r\n\r\nAlso, as of right now a bunch of unit tests are broken (hence WIP).\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dcos/dcos-ui/issues/comments/423155255","html_url":"https://github.com/dcos/dcos-ui/pull/3305#issuecomment-423155255","issue_url":"https://api.github.com/repos/dcos/dcos-ui/issues/3305","id":423155255,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzE1NTI1NQ==","user":{"login":"GeorgiSTodorov","id":40791275,"node_id":"MDQ6VXNlcjQwNzkxMjc1","avatar_url":"https://avatars2.githubusercontent.com/u/40791275?v=4","gravatar_id":"","url":"https://api.github.com/users/GeorgiSTodorov","html_url":"https://github.com/GeorgiSTodorov","followers_url":"https://api.github.com/users/GeorgiSTodorov/followers","following_url":"https://api.github.com/users/GeorgiSTodorov/following{/other_user}","gists_url":"https://api.github.com/users/GeorgiSTodorov/gists{/gist_id}","starred_url":"https://api.github.com/users/GeorgiSTodorov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeorgiSTodorov/subscriptions","organizations_url":"https://api.github.com/users/GeorgiSTodorov/orgs","repos_url":"https://api.github.com/users/GeorgiSTodorov/repos","events_url":"https://api.github.com/users/GeorgiSTodorov/events{/privacy}","received_events_url":"https://api.github.com/users/GeorgiSTodorov/received_events","type":"User","site_admin":false},"created_at":"2018-09-20T11:53:35Z","updated_at":"2018-09-20T11:53:35Z","author_association":"CONTRIBUTOR","body":"I used the JSON from the jira, but at the time of the screenshot it was still deploying I think."}}
{"actor":{"display_login":"GeorgiSTodorov"}}