syncthing/cmd
Jakob Borg ffe7a2fcd7 cmd/syncthing, lib/config: Enable HTTP CPU/heap profile collection for users
This 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).

We 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.

The same is done for heap profiles, /rest/debug/heapprof, which does not
take any parameters.

The 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 or heap profile we can use, with the filename
telling us what version and architecture the profile is from.

On the command line, this becomes

    curl -O -J http://localhost:8082/rest/debug/cpuprof?duration=5s
    curl: Saved to filename
    'syncthing-cpu-darwin-amd64-v0.14.3+4-g935bcc0-110307.pprof'

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3467
2016-08-02 11:06:45 +00:00
..
stbench cmd/stbench: Add utility to run benchmark tests 2016-03-25 20:52:20 +00:00
stcompdirs mv internal lib 2015-08-09 09:35:26 +02:00
stdisco lib/protocol, lib/discover, lib/db: Use protocol buffer serialization (fixes #3080) 2016-07-04 10:40:29 +00:00
stdiscosrv cmd, lib: Fix ineffectual assignments (ineffasign) and comment spelling 2016-07-15 14:23:20 +00:00
stevents Change (default) GUI port from 8080 to 8384 ('ST' in ascii values) 2015-03-26 21:36:06 +01:00
stfileinfo Fix import paths 2015-09-22 19:38:46 +02:00
stfinddevice lib/connections: Refactor 2016-05-04 19:38:12 +00:00
stgenfiles cmd/stgenfiles: Add utility for generating test data 2016-03-25 20:50:48 +00:00
stindex lib/protocol, lib/discover, lib/db: Use protocol buffer serialization (fixes #3080) 2016-07-04 10:40:29 +00:00
strelaypoolsrv cmd, lib: Fix ineffectual assignments (ineffasign) and comment spelling 2016-07-15 14:23:20 +00:00
strelaysrv build, cmd/stdiscosrv, cmd/strelaysrv: Rename binaries to add "st" prefix 2016-07-04 10:51:22 +00:00
stsigtool cmd/stsigtool: Sign stdin when not given a file to sign, or when given "-" 2016-05-05 19:05:45 +00:00
stvanity cmd/stvanity: x509.GenerateCertificate requires pointer for public key 2016-04-28 22:22:33 +00:00
stwatchfile Add stwatchfile 2015-07-27 19:00:22 +01:00
syncthing cmd/syncthing, lib/config: Enable HTTP CPU/heap profile collection for users 2016-08-02 11:06:45 +00:00
todos MPLv2 2015-03-17 16:02:27 +01:00
.gitignore Remove reprecated st* utils 2014-07-01 12:20:25 +02:00