{"action":"created","comment":{"url":"https://api.github.com/repos/kata-containers/runtime/pulls/comments/261250283","pull_request_review_id":209140927,"id":261250283,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2MTI1MDI4Mw==","diff_hunk":"@@ -105,6 +105,15 @@ func WriteToFile(path string, data []byte) error {\n \treturn nil\n }\n \n+//CalculatemCPUs converts CPU quota and period to milli-CPUs\n+func CalculatemCPUs(quota int64, period uint64) uint {\n+\tif quota != 0 && period != 0 {\n+\t\treturn uint((uint64(quota) * 100) / period)","path":"virtcontainers/utils/utils.go","position":null,"original_position":7,"commit_id":"25f449ea3dffd3f17cb1c7e8d8ad6aea112ee13e","original_commit_id":"418e173c6fcdcfd566ba9fe10bae9153e4cb9947","user":{"login":"egernst","id":20174683,"node_id":"MDQ6VXNlcjIwMTc0Njgz","avatar_url":"https://avatars1.githubusercontent.com/u/20174683?v=4","gravatar_id":"","url":"https://api.github.com/users/egernst","html_url":"https://github.com/egernst","followers_url":"https://api.github.com/users/egernst/followers","following_url":"https://api.github.com/users/egernst/following{/other_user}","gists_url":"https://api.github.com/users/egernst/gists{/gist_id}","starred_url":"https://api.github.com/users/egernst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egernst/subscriptions","organizations_url":"https://api.github.com/users/egernst/orgs","repos_url":"https://api.github.com/users/egernst/repos","events_url":"https://api.github.com/users/egernst/events{/privacy}","received_events_url":"https://api.github.com/users/egernst/received_events","type":"User","site_admin":false},"body":"ACK - renamed, and handling the -1 case.","created_at":"2019-02-28T15:34:40Z","updated_at":"2019-02-28T15:34:40Z","html_url":"https://github.com/kata-containers/runtime/pull/1294#discussion_r261250283","pull_request_url":"https://api.github.com/repos/kata-containers/runtime/pulls/1294","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/kata-containers/runtime/pulls/comments/261250283"},"html":{"href":"https://github.com/kata-containers/runtime/pull/1294#discussion_r261250283"},"pull_request":{"href":"https://api.github.com/repos/kata-containers/runtime/pulls/1294"}},"in_reply_to_id":261065808},"pull_request":{"url":"https://api.github.com/repos/kata-containers/runtime/pulls/1294","id":256946531,"node_id":"MDExOlB1bGxSZXF1ZXN0MjU2OTQ2NTMx","html_url":"https://github.com/kata-containers/runtime/pull/1294","diff_url":"https://github.com/kata-containers/runtime/pull/1294.diff","patch_url":"https://github.com/kata-containers/runtime/pull/1294.patch","issue_url":"https://api.github.com/repos/kata-containers/runtime/issues/1294","number":1294,"state":"open","locked":false,"title":"virtcontainers: fix vCPU calculation errors","user":{"login":"egernst","id":20174683,"node_id":"MDQ6VXNlcjIwMTc0Njgz","avatar_url":"https://avatars1.githubusercontent.com/u/20174683?v=4","gravatar_id":"","url":"https://api.github.com/users/egernst","html_url":"https://github.com/egernst","followers_url":"https://api.github.com/users/egernst/followers","following_url":"https://api.github.com/users/egernst/following{/other_user}","gists_url":"https://api.github.com/users/egernst/gists{/gist_id}","starred_url":"https://api.github.com/users/egernst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egernst/subscriptions","organizations_url":"https://api.github.com/users/egernst/orgs","repos_url":"https://api.github.com/users/egernst/repos","events_url":"https://api.github.com/users/egernst/events{/privacy}","received_events_url":"https://api.github.com/users/egernst/received_events","type":"User","site_admin":false},"body":"We were grabbing a running total of quota and period for each container\r\nand then calculating the number of resulting vCPUs. Summing period\r\ndoesn't make sense.  To simplify, let's just calculate mCPU per\r\ncontainer, keep a running total of mCPUs requested, and then translate\r\nto sandbox vCPUs after.\r\n\r\nFixes: #1292\r\n\r\nSigned-off-by: Eric Ernst <eric.ernst@intel.com>","created_at":"2019-02-28T06:23:16Z","updated_at":"2019-02-28T15:34:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9d2cfe3bc7f03dbc1d831f10fef43314265d5b0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1054688613,"node_id":"MDU6TGFiZWwxMDU0Njg4NjEz","url":"https://api.github.com/repos/kata-containers/runtime/labels/stable-candidate","name":"stable-candidate","color":"79e5ad","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kata-containers/runtime/pulls/1294/commits","review_comments_url":"https://api.github.com/repos/kata-containers/runtime/pulls/1294/comments","review_comment_url":"https://api.github.com/repos/kata-containers/runtime/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kata-containers/runtime/issues/1294/comments","statuses_url":"https://api.github.com/repos/kata-containers/runtime/statuses/25f449ea3dffd3f17cb1c7e8d8ad6aea112ee13e","head":{"label":"egernst:vCPU-calculations-fix","ref":"vCPU-calculations-fix","sha":"25f449ea3dffd3f17cb1c7e8d8ad6aea112ee13e","user":{"login":"egernst","id":20174683,"node_id":"MDQ6VXNlcjIwMTc0Njgz","avatar_url":"https://avatars1.githubusercontent.com/u/20174683?v=4","gravatar_id":"","url":"https://api.github.com/users/egernst","html_url":"https://github.com/egernst","followers_url":"https://api.github.com/users/egernst/followers","following_url":"https://api.github.com/users/egernst/following{/other_user}","gists_url":"https://api.github.com/users/egernst/gists{/gist_id}","starred_url":"https://api.github.com/users/egernst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egernst/subscriptions","organizations_url":"https://api.github.com/users/egernst/orgs","repos_url":"https://api.github.com/users/egernst/repos","events_url":"https://api.github.com/users/egernst/events{/privacy}","received_events_url":"https://api.github.com/users/egernst/received_events","type":"User","site_admin":false},"repo":{"id":146634029,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY2MzQwMjk=","name":"runtime","full_name":"egernst/runtime","private":false,"owner":{"login":"egernst","id":20174683,"node_id":"MDQ6VXNlcjIwMTc0Njgz","avatar_url":"https://avatars1.githubusercontent.com/u/20174683?v=4","gravatar_id":"","url":"https://api.github.com/users/egernst","html_url":"https://github.com/egernst","followers_url":"https://api.github.com/users/egernst/followers","following_url":"https://api.github.com/users/egernst/following{/other_user}","gists_url":"https://api.github.com/users/egernst/gists{/gist_id}","starred_url":"https://api.github.com/users/egernst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egernst/subscriptions","organizations_url":"https://api.github.com/users/egernst/orgs","repos_url":"https://api.github.com/users/egernst/repos","events_url":"https://api.github.com/users/egernst/events{/privacy}","received_events_url":"https://api.github.com/users/egernst/received_events","type":"User","site_admin":false},"html_url":"https://github.com/egernst/runtime","description":"Kata Containers runtime","fork":true,"url":"https://api.github.com/repos/egernst/runtime","forks_url":"https://api.github.com/repos/egernst/runtime/forks","keys_url":"https://api.github.com/repos/egernst/runtime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/egernst/runtime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/egernst/runtime/teams","hooks_url":"https://api.github.com/repos/egernst/runtime/hooks","issue_events_url":"https://api.github.com/repos/egernst/runtime/issues/events{/number}","events_url":"https://api.github.com/repos/egernst/runtime/events","assignees_url":"https://api.github.com/repos/egernst/runtime/assignees{/user}","branches_url":"https://api.github.com/repos/egernst/runtime/branches{/branch}","tags_url":"https://api.github.com/repos/egernst/runtime/tags","blobs_url":"https://api.github.com/repos/egernst/runtime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/egernst/runtime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/egernst/runtime/git/refs{/sha}","trees_url":"https://api.github.com/repos/egernst/runtime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/egernst/runtime/statuses/{sha}","languages_url":"https://api.github.com/repos/egernst/runtime/languages","stargazers_url":"https://api.github.com/repos/egernst/runtime/stargazers","contributors_url":"https://api.github.com/repos/egernst/runtime/contributors","subscribers_url":"https://api.github.com/repos/egernst/runtime/subscribers","subscription_url":"https://api.github.com/repos/egernst/runtime/subscription","commits_url":"https://api.github.com/repos/egernst/runtime/commits{/sha}","git_commits_url":"https://api.github.com/repos/egernst/runtime/git/commits{/sha}","comments_url":"https://api.github.com/repos/egernst/runtime/comments{/number}","issue_comment_url":"https://api.github.com/repos/egernst/runtime/issues/comments{/number}","contents_url":"https://api.github.com/repos/egernst/runtime/contents/{+path}","compare_url":"https://api.github.com/repos/egernst/runtime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/egernst/runtime/merges","archive_url":"https://api.github.com/repos/egernst/runtime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/egernst/runtime/downloads","issues_url":"https://api.github.com/repos/egernst/runtime/issues{/number}","pulls_url":"https://api.github.com/repos/egernst/runtime/pulls{/number}","milestones_url":"https://api.github.com/repos/egernst/runtime/milestones{/number}","notifications_url":"https://api.github.com/repos/egernst/runtime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/egernst/runtime/labels{/name}","releases_url":"https://api.github.com/repos/egernst/runtime/releases{/id}","deployments_url":"https://api.github.com/repos/egernst/runtime/deployments","created_at":"2018-08-29T17:19:59Z","updated_at":"2018-08-29T17:20:02Z","pushed_at":"2019-02-28T15:33:35Z","git_url":"git://github.com/egernst/runtime.git","ssh_url":"git@github.com:egernst/runtime.git","clone_url":"https://github.com/egernst/runtime.git","svn_url":"https://github.com/egernst/runtime","homepage":"","size":7329,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"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":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kata-containers:master","ref":"master","sha":"dbfd96583a5e8204ac92c68242618d0db8e5576c","user":{"login":"kata-containers","id":33289952,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMjg5OTUy","avatar_url":"https://avatars3.githubusercontent.com/u/33289952?v=4","gravatar_id":"","url":"https://api.github.com/users/kata-containers","html_url":"https://github.com/kata-containers","followers_url":"https://api.github.com/users/kata-containers/followers","following_url":"https://api.github.com/users/kata-containers/following{/other_user}","gists_url":"https://api.github.com/users/kata-containers/gists{/gist_id}","starred_url":"https://api.github.com/users/kata-containers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kata-containers/subscriptions","organizations_url":"https://api.github.com/users/kata-containers/orgs","repos_url":"https://api.github.com/users/kata-containers/repos","events_url":"https://api.github.com/users/kata-containers/events{/privacy}","received_events_url":"https://api.github.com/users/kata-containers/received_events","type":"Organization","site_admin":false},"repo":{"id":110539997,"node_id":"MDEwOlJlcG9zaXRvcnkxMTA1Mzk5OTc=","name":"runtime","full_name":"kata-containers/runtime","private":false,"owner":{"login":"kata-containers","id":33289952,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMjg5OTUy","avatar_url":"https://avatars3.githubusercontent.com/u/33289952?v=4","gravatar_id":"","url":"https://api.github.com/users/kata-containers","html_url":"https://github.com/kata-containers","followers_url":"https://api.github.com/users/kata-containers/followers","following_url":"https://api.github.com/users/kata-containers/following{/other_user}","gists_url":"https://api.github.com/users/kata-containers/gists{/gist_id}","starred_url":"https://api.github.com/users/kata-containers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kata-containers/subscriptions","organizations_url":"https://api.github.com/users/kata-containers/orgs","repos_url":"https://api.github.com/users/kata-containers/repos","events_url":"https://api.github.com/users/kata-containers/events{/privacy}","received_events_url":"https://api.github.com/users/kata-containers/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/kata-containers/runtime","description":"Kata Containers runtime","fork":false,"url":"https://api.github.com/repos/kata-containers/runtime","forks_url":"https://api.github.com/repos/kata-containers/runtime/forks","keys_url":"https://api.github.com/repos/kata-containers/runtime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kata-containers/runtime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kata-containers/runtime/teams","hooks_url":"https://api.github.com/repos/kata-containers/runtime/hooks","issue_events_url":"https://api.github.com/repos/kata-containers/runtime/issues/events{/number}","events_url":"https://api.github.com/repos/kata-containers/runtime/events","assignees_url":"https://api.github.com/repos/kata-containers/runtime/assignees{/user}","branches_url":"https://api.github.com/repos/kata-containers/runtime/branches{/branch}","tags_url":"https://api.github.com/repos/kata-containers/runtime/tags","blobs_url":"https://api.github.com/repos/kata-containers/runtime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kata-containers/runtime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kata-containers/runtime/git/refs{/sha}","trees_url":"https://api.github.com/repos/kata-containers/runtime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kata-containers/runtime/statuses/{sha}","languages_url":"https://api.github.com/repos/kata-containers/runtime/languages","stargazers_url":"https://api.github.com/repos/kata-containers/runtime/stargazers","contributors_url":"https://api.github.com/repos/kata-containers/runtime/contributors","subscribers_url":"https://api.github.com/repos/kata-containers/runtime/subscribers","subscription_url":"https://api.github.com/repos/kata-containers/runtime/subscription","commits_url":"https://api.github.com/repos/kata-containers/runtime/commits{/sha}","git_commits_url":"https://api.github.com/repos/kata-containers/runtime/git/commits{/sha}","comments_url":"https://api.github.com/repos/kata-containers/runtime/comments{/number}","issue_comment_url":"https://api.github.com/repos/kata-containers/runtime/issues/comments{/number}","contents_url":"https://api.github.com/repos/kata-containers/runtime/contents/{+path}","compare_url":"https://api.github.com/repos/kata-containers/runtime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kata-containers/runtime/merges","archive_url":"https://api.github.com/repos/kata-containers/runtime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kata-containers/runtime/downloads","issues_url":"https://api.github.com/repos/kata-containers/runtime/issues{/number}","pulls_url":"https://api.github.com/repos/kata-containers/runtime/pulls{/number}","milestones_url":"https://api.github.com/repos/kata-containers/runtime/milestones{/number}","notifications_url":"https://api.github.com/repos/kata-containers/runtime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kata-containers/runtime/labels{/name}","releases_url":"https://api.github.com/repos/kata-containers/runtime/releases{/id}","deployments_url":"https://api.github.com/repos/kata-containers/runtime/deployments","created_at":"2017-11-13T11:29:03Z","updated_at":"2019-02-28T14:52:57Z","pushed_at":"2019-02-28T15:33:37Z","git_url":"git://github.com/kata-containers/runtime.git","ssh_url":"git@github.com:kata-containers/runtime.git","clone_url":"https://github.com/kata-containers/runtime.git","svn_url":"https://github.com/kata-containers/runtime","homepage":"","size":7198,"stargazers_count":955,"watchers_count":955,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":170,"mirror_url":null,"archived":false,"open_issues_count":291,"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":170,"open_issues":291,"watchers":955,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kata-containers/runtime/pulls/1294"},"html":{"href":"https://github.com/kata-containers/runtime/pull/1294"},"issue":{"href":"https://api.github.com/repos/kata-containers/runtime/issues/1294"},"comments":{"href":"https://api.github.com/repos/kata-containers/runtime/issues/1294/comments"},"review_comments":{"href":"https://api.github.com/repos/kata-containers/runtime/pulls/1294/comments"},"review_comment":{"href":"https://api.github.com/repos/kata-containers/runtime/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kata-containers/runtime/pulls/1294/commits"},"statuses":{"href":"https://api.github.com/repos/kata-containers/runtime/statuses/25f449ea3dffd3f17cb1c7e8d8ad6aea112ee13e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"egernst"}}