{"action":"created","comment":{"url":"https://api.github.com/repos/kelda/kelda/pulls/comments/172241325","pull_request_review_id":101224516,"id":172241325,"diff_hunk":"@@ -104,8 +107,47 @@ var newDigitalOcean = func(namespace, region string) (*Provider, error) {\n \treturn prvdr, nil\n }\n \n+var listAllMutex sync.Mutex\n+var listAllTimeout time.Time\n+var listAllMachines []taggedMachine\n+var listAllErr error\n+\n // List will fetch all droplets that have the same name as the cluster namespace.\n func (prvdr Provider) List() (machines []db.Machine, err error) {\n+\tlistAllMutex.Lock()\n+\tif time.Now().After(listAllTimeout) {\n+\t\tc.Inc(\"List Cache Hit\")","path":"cloud/digitalocean/digitalocean.go","position":33,"original_position":33,"commit_id":"04a932077ad9b0cf0eec9226605bada49c3038c9","original_commit_id":"04a932077ad9b0cf0eec9226605bada49c3038c9","user":{"login":"kklin","id":1811185,"avatar_url":"https://avatars3.githubusercontent.com/u/1811185?v=4","gravatar_id":"","url":"https://api.github.com/users/kklin","html_url":"https://github.com/kklin","followers_url":"https://api.github.com/users/kklin/followers","following_url":"https://api.github.com/users/kklin/following{/other_user}","gists_url":"https://api.github.com/users/kklin/gists{/gist_id}","starred_url":"https://api.github.com/users/kklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kklin/subscriptions","organizations_url":"https://api.github.com/users/kklin/orgs","repos_url":"https://api.github.com/users/kklin/repos","events_url":"https://api.github.com/users/kklin/events{/privacy}","received_events_url":"https://api.github.com/users/kklin/received_events","type":"User","site_admin":false},"body":"The counter should be for a cache miss","created_at":"2018-03-05T16:16:55Z","updated_at":"2018-03-05T16:23:13Z","html_url":"https://github.com/kelda/kelda/pull/1408#discussion_r172241325","pull_request_url":"https://api.github.com/repos/kelda/kelda/pulls/1408","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/kelda/kelda/pulls/comments/172241325"},"html":{"href":"https://github.com/kelda/kelda/pull/1408#discussion_r172241325"},"pull_request":{"href":"https://api.github.com/repos/kelda/kelda/pulls/1408"}}},"pull_request":{"url":"https://api.github.com/repos/kelda/kelda/pulls/1408","id":172687323,"html_url":"https://github.com/kelda/kelda/pull/1408","diff_url":"https://github.com/kelda/kelda/pull/1408.diff","patch_url":"https://github.com/kelda/kelda/pull/1408.patch","issue_url":"https://api.github.com/repos/kelda/kelda/issues/1408","number":1408,"state":"open","locked":false,"title":"digitalocean: Cache List() calls","user":{"login":"ejj","id":620438,"avatar_url":"https://avatars2.githubusercontent.com/u/620438?v=4","gravatar_id":"","url":"https://api.github.com/users/ejj","html_url":"https://github.com/ejj","followers_url":"https://api.github.com/users/ejj/followers","following_url":"https://api.github.com/users/ejj/following{/other_user}","gists_url":"https://api.github.com/users/ejj/gists{/gist_id}","starred_url":"https://api.github.com/users/ejj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejj/subscriptions","organizations_url":"https://api.github.com/users/ejj/orgs","repos_url":"https://api.github.com/users/ejj/repos","events_url":"https://api.github.com/users/ejj/events{/privacy}","received_events_url":"https://api.github.com/users/ejj/received_events","type":"User","site_admin":false},"body":"Digital Ocean has a rather aggressive API request limit that we're\nhitting in integration tests.  Part of the problem, is that the API is\nglobal, serving all regions, rather than segregated per region as it\nis in other cloud providers.  This means that instead of making a\nsingle List() call that could request all droplets, we were making a\nlist call per region, artificially inflating our requests per second.\nThis patch solves the issue by caching the result of a List() call for\n1 second, allowing it to be reused by other regions without making API\nrequests.","created_at":"2018-03-03T21:03:56Z","updated_at":"2018-03-05T16:23:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a3ce6c9374403d3ce7f560f454d5e4111b7a19d4","assignee":null,"assignees":[],"requested_reviewers":[{"login":"luise","id":10263364,"avatar_url":"https://avatars3.githubusercontent.com/u/10263364?v=4","gravatar_id":"","url":"https://api.github.com/users/luise","html_url":"https://github.com/luise","followers_url":"https://api.github.com/users/luise/followers","following_url":"https://api.github.com/users/luise/following{/other_user}","gists_url":"https://api.github.com/users/luise/gists{/gist_id}","starred_url":"https://api.github.com/users/luise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luise/subscriptions","organizations_url":"https://api.github.com/users/luise/orgs","repos_url":"https://api.github.com/users/luise/repos","events_url":"https://api.github.com/users/luise/events{/privacy}","received_events_url":"https://api.github.com/users/luise/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kelda/kelda/pulls/1408/commits","review_comments_url":"https://api.github.com/repos/kelda/kelda/pulls/1408/comments","review_comment_url":"https://api.github.com/repos/kelda/kelda/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kelda/kelda/issues/1408/comments","statuses_url":"https://api.github.com/repos/kelda/kelda/statuses/04a932077ad9b0cf0eec9226605bada49c3038c9","head":{"label":"ejj:list","ref":"list","sha":"04a932077ad9b0cf0eec9226605bada49c3038c9","user":{"login":"ejj","id":620438,"avatar_url":"https://avatars2.githubusercontent.com/u/620438?v=4","gravatar_id":"","url":"https://api.github.com/users/ejj","html_url":"https://github.com/ejj","followers_url":"https://api.github.com/users/ejj/followers","following_url":"https://api.github.com/users/ejj/following{/other_user}","gists_url":"https://api.github.com/users/ejj/gists{/gist_id}","starred_url":"https://api.github.com/users/ejj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejj/subscriptions","organizations_url":"https://api.github.com/users/ejj/orgs","repos_url":"https://api.github.com/users/ejj/repos","events_url":"https://api.github.com/users/ejj/events{/privacy}","received_events_url":"https://api.github.com/users/ejj/received_events","type":"User","site_admin":false},"repo":{"id":63499071,"name":"kelda","full_name":"ejj/kelda","owner":{"login":"ejj","id":620438,"avatar_url":"https://avatars2.githubusercontent.com/u/620438?v=4","gravatar_id":"","url":"https://api.github.com/users/ejj","html_url":"https://github.com/ejj","followers_url":"https://api.github.com/users/ejj/followers","following_url":"https://api.github.com/users/ejj/following{/other_user}","gists_url":"https://api.github.com/users/ejj/gists{/gist_id}","starred_url":"https://api.github.com/users/ejj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejj/subscriptions","organizations_url":"https://api.github.com/users/ejj/orgs","repos_url":"https://api.github.com/users/ejj/repos","events_url":"https://api.github.com/users/ejj/events{/privacy}","received_events_url":"https://api.github.com/users/ejj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ejj/kelda","description":"Quilt","fork":true,"url":"https://api.github.com/repos/ejj/kelda","forks_url":"https://api.github.com/repos/ejj/kelda/forks","keys_url":"https://api.github.com/repos/ejj/kelda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ejj/kelda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ejj/kelda/teams","hooks_url":"https://api.github.com/repos/ejj/kelda/hooks","issue_events_url":"https://api.github.com/repos/ejj/kelda/issues/events{/number}","events_url":"https://api.github.com/repos/ejj/kelda/events","assignees_url":"https://api.github.com/repos/ejj/kelda/assignees{/user}","branches_url":"https://api.github.com/repos/ejj/kelda/branches{/branch}","tags_url":"https://api.github.com/repos/ejj/kelda/tags","blobs_url":"https://api.github.com/repos/ejj/kelda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ejj/kelda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ejj/kelda/git/refs{/sha}","trees_url":"https://api.github.com/repos/ejj/kelda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ejj/kelda/statuses/{sha}","languages_url":"https://api.github.com/repos/ejj/kelda/languages","stargazers_url":"https://api.github.com/repos/ejj/kelda/stargazers","contributors_url":"https://api.github.com/repos/ejj/kelda/contributors","subscribers_url":"https://api.github.com/repos/ejj/kelda/subscribers","subscription_url":"https://api.github.com/repos/ejj/kelda/subscription","commits_url":"https://api.github.com/repos/ejj/kelda/commits{/sha}","git_commits_url":"https://api.github.com/repos/ejj/kelda/git/commits{/sha}","comments_url":"https://api.github.com/repos/ejj/kelda/comments{/number}","issue_comment_url":"https://api.github.com/repos/ejj/kelda/issues/comments{/number}","contents_url":"https://api.github.com/repos/ejj/kelda/contents/{+path}","compare_url":"https://api.github.com/repos/ejj/kelda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ejj/kelda/merges","archive_url":"https://api.github.com/repos/ejj/kelda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ejj/kelda/downloads","issues_url":"https://api.github.com/repos/ejj/kelda/issues{/number}","pulls_url":"https://api.github.com/repos/ejj/kelda/pulls{/number}","milestones_url":"https://api.github.com/repos/ejj/kelda/milestones{/number}","notifications_url":"https://api.github.com/repos/ejj/kelda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ejj/kelda/labels{/name}","releases_url":"https://api.github.com/repos/ejj/kelda/releases{/id}","deployments_url":"https://api.github.com/repos/ejj/kelda/deployments","created_at":"2016-07-16T19:26:14Z","updated_at":"2017-10-17T17:17:37Z","pushed_at":"2018-03-03T21:03:50Z","git_url":"git://github.com/ejj/kelda.git","ssh_url":"git@github.com:ejj/kelda.git","clone_url":"https://github.com/ejj/kelda.git","svn_url":"https://github.com/ejj/kelda","homepage":"","size":25056,"stargazers_count":1,"watchers_count":1,"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":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"kelda:master","ref":"master","sha":"ecfd9516fcd1082e63f45ea42b2603aea52d40ef","user":{"login":"kelda","id":25753912,"avatar_url":"https://avatars2.githubusercontent.com/u/25753912?v=4","gravatar_id":"","url":"https://api.github.com/users/kelda","html_url":"https://github.com/kelda","followers_url":"https://api.github.com/users/kelda/followers","following_url":"https://api.github.com/users/kelda/following{/other_user}","gists_url":"https://api.github.com/users/kelda/gists{/gist_id}","starred_url":"https://api.github.com/users/kelda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kelda/subscriptions","organizations_url":"https://api.github.com/users/kelda/orgs","repos_url":"https://api.github.com/users/kelda/repos","events_url":"https://api.github.com/users/kelda/events{/privacy}","received_events_url":"https://api.github.com/users/kelda/received_events","type":"Organization","site_admin":false},"repo":{"id":43390663,"name":"kelda","full_name":"kelda/kelda","owner":{"login":"kelda","id":25753912,"avatar_url":"https://avatars2.githubusercontent.com/u/25753912?v=4","gravatar_id":"","url":"https://api.github.com/users/kelda","html_url":"https://github.com/kelda","followers_url":"https://api.github.com/users/kelda/followers","following_url":"https://api.github.com/users/kelda/following{/other_user}","gists_url":"https://api.github.com/users/kelda/gists{/gist_id}","starred_url":"https://api.github.com/users/kelda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kelda/subscriptions","organizations_url":"https://api.github.com/users/kelda/orgs","repos_url":"https://api.github.com/users/kelda/repos","events_url":"https://api.github.com/users/kelda/events{/privacy}","received_events_url":"https://api.github.com/users/kelda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kelda/kelda","description":"Kelda is an approachable way to deploy to the cloud.","fork":false,"url":"https://api.github.com/repos/kelda/kelda","forks_url":"https://api.github.com/repos/kelda/kelda/forks","keys_url":"https://api.github.com/repos/kelda/kelda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kelda/kelda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kelda/kelda/teams","hooks_url":"https://api.github.com/repos/kelda/kelda/hooks","issue_events_url":"https://api.github.com/repos/kelda/kelda/issues/events{/number}","events_url":"https://api.github.com/repos/kelda/kelda/events","assignees_url":"https://api.github.com/repos/kelda/kelda/assignees{/user}","branches_url":"https://api.github.com/repos/kelda/kelda/branches{/branch}","tags_url":"https://api.github.com/repos/kelda/kelda/tags","blobs_url":"https://api.github.com/repos/kelda/kelda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kelda/kelda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kelda/kelda/git/refs{/sha}","trees_url":"https://api.github.com/repos/kelda/kelda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kelda/kelda/statuses/{sha}","languages_url":"https://api.github.com/repos/kelda/kelda/languages","stargazers_url":"https://api.github.com/repos/kelda/kelda/stargazers","contributors_url":"https://api.github.com/repos/kelda/kelda/contributors","subscribers_url":"https://api.github.com/repos/kelda/kelda/subscribers","subscription_url":"https://api.github.com/repos/kelda/kelda/subscription","commits_url":"https://api.github.com/repos/kelda/kelda/commits{/sha}","git_commits_url":"https://api.github.com/repos/kelda/kelda/git/commits{/sha}","comments_url":"https://api.github.com/repos/kelda/kelda/comments{/number}","issue_comment_url":"https://api.github.com/repos/kelda/kelda/issues/comments{/number}","contents_url":"https://api.github.com/repos/kelda/kelda/contents/{+path}","compare_url":"https://api.github.com/repos/kelda/kelda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kelda/kelda/merges","archive_url":"https://api.github.com/repos/kelda/kelda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kelda/kelda/downloads","issues_url":"https://api.github.com/repos/kelda/kelda/issues{/number}","pulls_url":"https://api.github.com/repos/kelda/kelda/pulls{/number}","milestones_url":"https://api.github.com/repos/kelda/kelda/milestones{/number}","notifications_url":"https://api.github.com/repos/kelda/kelda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kelda/kelda/labels{/name}","releases_url":"https://api.github.com/repos/kelda/kelda/releases{/id}","deployments_url":"https://api.github.com/repos/kelda/kelda/deployments","created_at":"2015-09-29T19:52:32Z","updated_at":"2018-02-28T07:26:02Z","pushed_at":"2018-03-04T22:48:53Z","git_url":"git://github.com/kelda/kelda.git","ssh_url":"git@github.com:kelda/kelda.git","clone_url":"https://github.com/kelda/kelda.git","svn_url":"https://github.com/kelda/kelda","homepage":"http://kelda.io","size":24930,"stargazers_count":436,"watchers_count":436,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":41,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":41,"open_issues":20,"watchers":436,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kelda/kelda/pulls/1408"},"html":{"href":"https://github.com/kelda/kelda/pull/1408"},"issue":{"href":"https://api.github.com/repos/kelda/kelda/issues/1408"},"comments":{"href":"https://api.github.com/repos/kelda/kelda/issues/1408/comments"},"review_comments":{"href":"https://api.github.com/repos/kelda/kelda/pulls/1408/comments"},"review_comment":{"href":"https://api.github.com/repos/kelda/kelda/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kelda/kelda/pulls/1408/commits"},"statuses":{"href":"https://api.github.com/repos/kelda/kelda/statuses/04a932077ad9b0cf0eec9226605bada49c3038c9"}},"author_association":"OWNER"}}
{"actor":{"display_login":"kklin"}}