{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/comments/36257829","id":36257829,"diff_hunk":"@@ -264,11 +306,13 @@ func (rc *realCache) GetEvents(start, end time.Time) []*Event {\n }\n \n func NewCache(bufferDuration time.Duration) Cache {\n-\treturn &realCache{\n+\trc := &realCache{\n \t\tpods:           make(map[string]*podElement),\n \t\tnodes:          make(map[string]*nodeElement),\n \t\tevents:         store.NewGCStore(store.NewTimeStore(), bufferDuration),\n \t\teventUIDs:      make(map[string]struct{}),\n \t\tbufferDuration: bufferDuration,\n \t}\n+\tgo util.Until(rc.runGC, time.Second, util.NeverStop)","path":"sinks/cache/cache_impl.go","position":null,"original_position":196,"commit_id":"72203f4621f6d68f8315e8191c9bcd81b92c042f","original_commit_id":"1ebe4cc2c244fffcbcd3e050447781be38fad9f1","user":{"login":"vishh","id":7063592,"avatar_url":"https://avatars.githubusercontent.com/u/7063592?v=3","gravatar_id":"","url":"https://api.github.com/users/vishh","html_url":"https://github.com/vishh","followers_url":"https://api.github.com/users/vishh/followers","following_url":"https://api.github.com/users/vishh/following{/other_user}","gists_url":"https://api.github.com/users/vishh/gists{/gist_id}","starred_url":"https://api.github.com/users/vishh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vishh/subscriptions","organizations_url":"https://api.github.com/users/vishh/orgs","repos_url":"https://api.github.com/users/vishh/repos","events_url":"https://api.github.com/users/vishh/events{/privacy}","received_events_url":"https://api.github.com/users/vishh/received_events","type":"User","site_admin":false},"body":"Good point! Manually controlling gc duration makes sense. Updated code. ","created_at":"2015-08-05T00:13:09Z","updated_at":"2015-08-05T00:13:09Z","html_url":"https://github.com/GoogleCloudPlatform/heapster/pull/453#discussion_r36257829","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/453","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/comments/36257829"},"html":{"href":"https://github.com/GoogleCloudPlatform/heapster/pull/453#discussion_r36257829"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/453"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/453","id":41629930,"html_url":"https://github.com/GoogleCloudPlatform/heapster/pull/453","diff_url":"https://github.com/GoogleCloudPlatform/heapster/pull/453.diff","patch_url":"https://github.com/GoogleCloudPlatform/heapster/pull/453.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/issues/453","number":453,"state":"open","locked":false,"title":"Fix cache garbage collection ","user":{"login":"vishh","id":7063592,"avatar_url":"https://avatars.githubusercontent.com/u/7063592?v=3","gravatar_id":"","url":"https://api.github.com/users/vishh","html_url":"https://github.com/vishh","followers_url":"https://api.github.com/users/vishh/followers","following_url":"https://api.github.com/users/vishh/following{/other_user}","gists_url":"https://api.github.com/users/vishh/gists{/gist_id}","starred_url":"https://api.github.com/users/vishh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vishh/subscriptions","organizations_url":"https://api.github.com/users/vishh/orgs","repos_url":"https://api.github.com/users/vishh/repos","events_url":"https://api.github.com/users/vishh/events{/privacy}","received_events_url":"https://api.github.com/users/vishh/received_events","type":"User","site_admin":false},"body":"Fixes #446.\r\n\r\ncc @a-robinson @afein @mvdan ","created_at":"2015-08-04T23:38:49Z","updated_at":"2015-08-05T00:13:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ffcb8a3c0c4d00c636efa1e729a38ac6ec9d763","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/453/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/453/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/issues/453/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/statuses/72203f4621f6d68f8315e8191c9bcd81b92c042f","head":{"label":"vishh:fix_cache_gc","ref":"fix_cache_gc","sha":"72203f4621f6d68f8315e8191c9bcd81b92c042f","user":{"login":"vishh","id":7063592,"avatar_url":"https://avatars.githubusercontent.com/u/7063592?v=3","gravatar_id":"","url":"https://api.github.com/users/vishh","html_url":"https://github.com/vishh","followers_url":"https://api.github.com/users/vishh/followers","following_url":"https://api.github.com/users/vishh/following{/other_user}","gists_url":"https://api.github.com/users/vishh/gists{/gist_id}","starred_url":"https://api.github.com/users/vishh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vishh/subscriptions","organizations_url":"https://api.github.com/users/vishh/orgs","repos_url":"https://api.github.com/users/vishh/repos","events_url":"https://api.github.com/users/vishh/events{/privacy}","received_events_url":"https://api.github.com/users/vishh/received_events","type":"User","site_admin":false},"repo":{"id":26147157,"name":"heapster-1","full_name":"vishh/heapster-1","owner":{"login":"vishh","id":7063592,"avatar_url":"https://avatars.githubusercontent.com/u/7063592?v=3","gravatar_id":"","url":"https://api.github.com/users/vishh","html_url":"https://github.com/vishh","followers_url":"https://api.github.com/users/vishh/followers","following_url":"https://api.github.com/users/vishh/following{/other_user}","gists_url":"https://api.github.com/users/vishh/gists{/gist_id}","starred_url":"https://api.github.com/users/vishh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vishh/subscriptions","organizations_url":"https://api.github.com/users/vishh/orgs","repos_url":"https://api.github.com/users/vishh/repos","events_url":"https://api.github.com/users/vishh/events{/privacy}","received_events_url":"https://api.github.com/users/vishh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vishh/heapster-1","description":"Monitor container resource usage of a Kubernetes cluster","fork":true,"url":"https://api.github.com/repos/vishh/heapster-1","forks_url":"https://api.github.com/repos/vishh/heapster-1/forks","keys_url":"https://api.github.com/repos/vishh/heapster-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vishh/heapster-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vishh/heapster-1/teams","hooks_url":"https://api.github.com/repos/vishh/heapster-1/hooks","issue_events_url":"https://api.github.com/repos/vishh/heapster-1/issues/events{/number}","events_url":"https://api.github.com/repos/vishh/heapster-1/events","assignees_url":"https://api.github.com/repos/vishh/heapster-1/assignees{/user}","branches_url":"https://api.github.com/repos/vishh/heapster-1/branches{/branch}","tags_url":"https://api.github.com/repos/vishh/heapster-1/tags","blobs_url":"https://api.github.com/repos/vishh/heapster-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vishh/heapster-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vishh/heapster-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/vishh/heapster-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vishh/heapster-1/statuses/{sha}","languages_url":"https://api.github.com/repos/vishh/heapster-1/languages","stargazers_url":"https://api.github.com/repos/vishh/heapster-1/stargazers","contributors_url":"https://api.github.com/repos/vishh/heapster-1/contributors","subscribers_url":"https://api.github.com/repos/vishh/heapster-1/subscribers","subscription_url":"https://api.github.com/repos/vishh/heapster-1/subscription","commits_url":"https://api.github.com/repos/vishh/heapster-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/vishh/heapster-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/vishh/heapster-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/vishh/heapster-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/vishh/heapster-1/contents/{+path}","compare_url":"https://api.github.com/repos/vishh/heapster-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vishh/heapster-1/merges","archive_url":"https://api.github.com/repos/vishh/heapster-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vishh/heapster-1/downloads","issues_url":"https://api.github.com/repos/vishh/heapster-1/issues{/number}","pulls_url":"https://api.github.com/repos/vishh/heapster-1/pulls{/number}","milestones_url":"https://api.github.com/repos/vishh/heapster-1/milestones{/number}","notifications_url":"https://api.github.com/repos/vishh/heapster-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vishh/heapster-1/labels{/name}","releases_url":"https://api.github.com/repos/vishh/heapster-1/releases{/id}","created_at":"2014-11-04T01:26:41Z","updated_at":"2015-06-19T20:42:06Z","pushed_at":"2015-08-05T00:12:57Z","git_url":"git://github.com/vishh/heapster-1.git","ssh_url":"git@github.com:vishh/heapster-1.git","clone_url":"https://github.com/vishh/heapster-1.git","svn_url":"https://github.com/vishh/heapster-1","homepage":"","size":22601,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"9e338214113356648d03b3753975ed60c4d59d9d","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":23272510,"name":"heapster","full_name":"GoogleCloudPlatform/heapster","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/heapster","description":"Monitor container resource usage of a Kubernetes cluster","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/heapster","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/heapster/releases{/id}","created_at":"2014-08-24T03:50:18Z","updated_at":"2015-08-04T18:36:30Z","pushed_at":"2015-08-05T00:12:57Z","git_url":"git://github.com/GoogleCloudPlatform/heapster.git","ssh_url":"git@github.com:GoogleCloudPlatform/heapster.git","clone_url":"https://github.com/GoogleCloudPlatform/heapster.git","svn_url":"https://github.com/GoogleCloudPlatform/heapster","homepage":"","size":22489,"stargazers_count":365,"watchers_count":365,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":97,"mirror_url":null,"open_issues_count":83,"forks":97,"open_issues":83,"watchers":365,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/453"},"html":{"href":"https://github.com/GoogleCloudPlatform/heapster/pull/453"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/heapster/issues/453"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/heapster/issues/453/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/453/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/heapster/pulls/453/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/heapster/statuses/72203f4621f6d68f8315e8191c9bcd81b92c042f"}}}}