{"action":"created","issue":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/3467","repository_url":"https://api.github.com/repos/syncthing/syncthing","labels_url":"https://api.github.com/repos/syncthing/syncthing/issues/3467/labels{/name}","comments_url":"https://api.github.com/repos/syncthing/syncthing/issues/3467/comments","events_url":"https://api.github.com/repos/syncthing/syncthing/issues/3467/events","html_url":"https://github.com/syncthing/syncthing/pull/3467","id":168834874,"number":3467,"title":"cmd/syncthing, lib/config: Enable HTTP CPU/heap profile collection for users","user":{"login":"calmh","id":125426,"avatar_url":"https://avatars.githubusercontent.com/u/125426?v=3","gravatar_id":"","url":"https://api.github.com/users/calmh","html_url":"https://github.com/calmh","followers_url":"https://api.github.com/users/calmh/followers","following_url":"https://api.github.com/users/calmh/following{/other_user}","gists_url":"https://api.github.com/users/calmh/gists{/gist_id}","starred_url":"https://api.github.com/users/calmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calmh/subscriptions","organizations_url":"https://api.github.com/users/calmh/orgs","repos_url":"https://api.github.com/users/calmh/repos","events_url":"https://api.github.com/users/calmh/events{/privacy}","received_events_url":"https://api.github.com/users/calmh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-02T09:07:17Z","updated_at":"2016-08-02T10:16:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/syncthing/syncthing/pulls/3467","html_url":"https://github.com/syncthing/syncthing/pull/3467","diff_url":"https://github.com/syncthing/syncthing/pull/3467.diff","patch_url":"https://github.com/syncthing/syncthing/pull/3467.patch"},"body":"### Purpose\r\n\r\nThis adds a config to enable debug functions on the API server, which is by default disabled. When enabled, the /rest/debug things become available and become available without requiring a CSRF token (although authentication is required if configured).\r\n\r\nWe also add a new endpoint /rest/debug/cpuprof?duration=15s (with the duration being configurable, defaulting to 30s). This runs a CPU profile for the duration and returns it as a file. It sets headers so that a browser will save the file with an informative name.\r\n\r\nThe same is done for heap profiles, /rest/debug/heapprof, which does not take any parameters. The heap profile won't contain historical allocations, but a snapshot of live data at the time it's taken.\r\n\r\nThe purpose of this is that any user can enable debugging under advanced, then point their browser to the endpoint above and get a file that contains a CPU/heap profile we can use, with the filename telling us what version and architecture the profile is from.\r\n\r\nOn the command line, this becomes\r\n\r\n    curl -O -J http://localhost:8082/rest/debug/cpuprof?duration=5s\r\n    curl: Saved to filename\r\n    'syncthing-cpu-darwin-amd64-v0.14.3+4-g935bcc0-110307.pprof'\r\n\r\n### Testing\r\n\r\nWorks for me\r\n"},"comment":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/comments/236863239","html_url":"https://github.com/syncthing/syncthing/pull/3467#issuecomment-236863239","issue_url":"https://api.github.com/repos/syncthing/syncthing/issues/3467","id":236863239,"user":{"login":"calmh","id":125426,"avatar_url":"https://avatars.githubusercontent.com/u/125426?v=3","gravatar_id":"","url":"https://api.github.com/users/calmh","html_url":"https://github.com/calmh","followers_url":"https://api.github.com/users/calmh/followers","following_url":"https://api.github.com/users/calmh/following{/other_user}","gists_url":"https://api.github.com/users/calmh/gists{/gist_id}","starred_url":"https://api.github.com/users/calmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calmh/subscriptions","organizations_url":"https://api.github.com/users/calmh/orgs","repos_url":"https://api.github.com/users/calmh/repos","events_url":"https://api.github.com/users/calmh/events{/privacy}","received_events_url":"https://api.github.com/users/calmh/received_events","type":"User","site_admin":false},"created_at":"2016-08-02T10:16:39Z","updated_at":"2016-08-02T10:16:39Z","body":"Yeah that looks OK to me as well."}}
{"actor":{"display_login":"calmh"}}