{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/174426295","pull_request_review_id":103777364,"id":174426295,"diff_hunk":"@@ -82,6 +84,21 @@ export function render( element, key = JSON.stringify( element ) ) {\n \t\tif ( ! renderedLayout ) {\n \t\t\tbumpStat( 'calypso-ssr', 'loggedout-design-cache-miss' );\n \t\t\tdebug( 'cache miss for key', key );\n+\t\t\tif ( Math.random() < 0.001 || config.isEnabled( 'ssr/always-log-cache-misses' ) ) {","path":"server/render/index.js","position":33,"original_position":33,"commit_id":"7ff1d272147a8a52e7eb80eb83108c616acaf5e1","original_commit_id":"7ff1d272147a8a52e7eb80eb83108c616acaf5e1","user":{"login":"seear","id":7767559,"avatar_url":"https://avatars3.githubusercontent.com/u/7767559?v=4","gravatar_id":"","url":"https://api.github.com/users/seear","html_url":"https://github.com/seear","followers_url":"https://api.github.com/users/seear/followers","following_url":"https://api.github.com/users/seear/following{/other_user}","gists_url":"https://api.github.com/users/seear/gists{/gist_id}","starred_url":"https://api.github.com/users/seear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seear/subscriptions","organizations_url":"https://api.github.com/users/seear/orgs","repos_url":"https://api.github.com/users/seear/repos","events_url":"https://api.github.com/users/seear/events{/privacy}","received_events_url":"https://api.github.com/users/seear/received_events","type":"User","site_admin":false},"body":"> It seems it would be nice to add config for this log sampling as well, config.isEnabled( 'ssr/sample-log-cache-misses' ) && Math.random() < 0.001 || …. What do you think?\r\n\r\n:boom: Great idea. Then we can enable the logging in production in a separate, easy to revert PR.","created_at":"2018-03-14T11:21:23Z","updated_at":"2018-03-14T11:21:24Z","html_url":"https://github.com/Automattic/wp-calypso/pull/23228#discussion_r174426295","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23228","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/174426295"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/23228#discussion_r174426295"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23228"}},"in_reply_to_id":174289956},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23228","id":174388072,"html_url":"https://github.com/Automattic/wp-calypso/pull/23228","diff_url":"https://github.com/Automattic/wp-calypso/pull/23228.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/23228.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/23228","number":23228,"state":"open","locked":false,"title":"SSR: Periodically snapshot cache keys to investigate spike in cache misses","user":{"login":"seear","id":7767559,"avatar_url":"https://avatars3.githubusercontent.com/u/7767559?v=4","gravatar_id":"","url":"https://api.github.com/users/seear","html_url":"https://github.com/seear","followers_url":"https://api.github.com/users/seear/followers","following_url":"https://api.github.com/users/seear/following{/other_user}","gists_url":"https://api.github.com/users/seear/gists{/gist_id}","starred_url":"https://api.github.com/users/seear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seear/subscriptions","organizations_url":"https://api.github.com/users/seear/orgs","repos_url":"https://api.github.com/users/seear/repos","events_url":"https://api.github.com/users/seear/events{/privacy}","received_events_url":"https://api.github.com/users/seear/received_events","type":"User","site_admin":false},"body":"Resurrecting #13419.\r\n\r\nUse the logstash API endpoint to take a snapshot of SSR cache keys.\r\n\r\n* Add data-layer for the endpoint\r\n* For 0.1% of misses (we are seeing 9000 an hour) log: the key that misses, all existing keys in the cache, the user-agent, and the request path.\r\n\r\n\r\n## Testing\r\n* Checkout this branch\r\n* build with `ENABLE_FEATURES=ssr/always-log-cache-misses npm start`\r\n* hit a few /themes routes, like /themes/blog, /themes/music\r\n* In Kibana, search on feature:calypso_ssr\r\n* You should see cache miss logs, with the detail in the `extra` field:\r\n<img width=\"1026\" alt=\"screen shot 2018-03-12 at 17 35 34\" src=\"https://user-images.githubusercontent.com/7767559/37299736-02a08af6-261c-11e8-8722-0c7d9952bb2c.png\">\r\n\r\n\r\n\r\n","created_at":"2018-03-12T14:39:26Z","updated_at":"2018-03-14T11:21:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23adc666ebcff5cf4cbe35dff9a2ddbf1ded634d","assignee":{"login":"seear","id":7767559,"avatar_url":"https://avatars3.githubusercontent.com/u/7767559?v=4","gravatar_id":"","url":"https://api.github.com/users/seear","html_url":"https://github.com/seear","followers_url":"https://api.github.com/users/seear/followers","following_url":"https://api.github.com/users/seear/following{/other_user}","gists_url":"https://api.github.com/users/seear/gists{/gist_id}","starred_url":"https://api.github.com/users/seear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seear/subscriptions","organizations_url":"https://api.github.com/users/seear/orgs","repos_url":"https://api.github.com/users/seear/repos","events_url":"https://api.github.com/users/seear/events{/privacy}","received_events_url":"https://api.github.com/users/seear/received_events","type":"User","site_admin":false},"assignees":[{"login":"seear","id":7767559,"avatar_url":"https://avatars3.githubusercontent.com/u/7767559?v=4","gravatar_id":"","url":"https://api.github.com/users/seear","html_url":"https://github.com/seear","followers_url":"https://api.github.com/users/seear/followers","following_url":"https://api.github.com/users/seear/following{/other_user}","gists_url":"https://api.github.com/users/seear/gists{/gist_id}","starred_url":"https://api.github.com/users/seear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seear/subscriptions","organizations_url":"https://api.github.com/users/seear/orgs","repos_url":"https://api.github.com/users/seear/repos","events_url":"https://api.github.com/users/seear/events{/privacy}","received_events_url":"https://api.github.com/users/seear/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"ockham","id":96308,"avatar_url":"https://avatars2.githubusercontent.com/u/96308?v=4","gravatar_id":"","url":"https://api.github.com/users/ockham","html_url":"https://github.com/ockham","followers_url":"https://api.github.com/users/ockham/followers","following_url":"https://api.github.com/users/ockham/following{/other_user}","gists_url":"https://api.github.com/users/ockham/gists{/gist_id}","starred_url":"https://api.github.com/users/ockham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ockham/subscriptions","organizations_url":"https://api.github.com/users/ockham/orgs","repos_url":"https://api.github.com/users/ockham/repos","events_url":"https://api.github.com/users/ockham/events{/privacy}","received_events_url":"https://api.github.com/users/ockham/received_events","type":"User","site_admin":false},{"login":"ehg","id":215074,"avatar_url":"https://avatars1.githubusercontent.com/u/215074?v=4","gravatar_id":"","url":"https://api.github.com/users/ehg","html_url":"https://github.com/ehg","followers_url":"https://api.github.com/users/ehg/followers","following_url":"https://api.github.com/users/ehg/following{/other_user}","gists_url":"https://api.github.com/users/ehg/gists{/gist_id}","starred_url":"https://api.github.com/users/ehg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehg/subscriptions","organizations_url":"https://api.github.com/users/ehg/orgs","repos_url":"https://api.github.com/users/ehg/repos","events_url":"https://api.github.com/users/ehg/events{/privacy}","received_events_url":"https://api.github.com/users/ehg/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":285010100,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Server%20Side%20Rendering","name":"Server Side Rendering","color":"bfdadc","default":false},{"id":285010018,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23228/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23228/comments","review_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/23228/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/7ff1d272147a8a52e7eb80eb83108c616acaf5e1","head":{"label":"Automattic:add/logging-endpoint","ref":"add/logging-endpoint","sha":"7ff1d272147a8a52e7eb80eb83108c616acaf5e1","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The JavaScript and API powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2018-03-14T08:55:09Z","pushed_at":"2018-03-14T11:07:54Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":80155,"stargazers_count":9792,"watchers_count":9792,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1369,"mirror_url":null,"archived":false,"open_issues_count":1476,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":1369,"open_issues":1476,"watchers":9792,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"5bab218b82c79bdae78c4cf0a290f243ac91bcf3","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars1.githubusercontent.com/u/887802?v=4","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The JavaScript and API powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2018-03-14T08:55:09Z","pushed_at":"2018-03-14T11:07:54Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":80155,"stargazers_count":9792,"watchers_count":9792,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1369,"mirror_url":null,"archived":false,"open_issues_count":1476,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":1369,"open_issues":1476,"watchers":9792,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23228"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/23228"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/23228"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/23228/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23228/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/23228/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/7ff1d272147a8a52e7eb80eb83108c616acaf5e1"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"seear"}}