syncthing/lib
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
..
auto build: Generate gui.files.go on the fly, remove from repo 2016-03-28 10:03:13 +00:00
beacon Remove unused struct field 2015-10-27 09:55:05 +01:00
config cmd/syncthing, lib/config: Enable HTTP CPU/heap profile collection for users 2016-08-02 11:06:45 +00:00
connections lib/protocol, lib/discover, lib/db: Use protocol buffer serialization (fixes #3080) 2016-07-04 10:40:29 +00:00
db all: Rename LocalVersion to Sequence (fixes #3461) 2016-07-29 19:54:24 +00:00
dialer lib/connections: Handle wrapped connection in SetTCPOptions (fixes #3223) 2016-05-31 08:11:57 +00:00
discover script, lib/discover: Fixup copyright checks 2016-07-04 14:53:11 +02:00
events lib/events: Make events test less likely to fail 2016-06-28 08:29:49 +02:00
ignore vendor: Update github.com/gobwas/glob (fixes #3174) 2016-05-28 04:43:54 +00:00
logger cmd/syncthing: Extract interfaces for things the API depends on 2016-03-21 19:36:08 +00:00
model gui: Add one-off notifications that need to be acked 2016-08-02 08:07:30 +00:00
nat lib/nat: Avoid concurrent reset of NAT timer (fixes #3337) 2016-06-26 10:17:12 +00:00
osutil lib/osutil: Return "/" as filesystem root on non-windows (fixes #3321) 2016-06-20 20:25:00 +00:00
pmp vendor: Revert to github.com/jackpal/gateway instead of fork 2016-06-02 20:40:30 +00:00
protocol all: Rename LocalVersion to Sequence (fixes #3461) 2016-07-29 19:54:24 +00:00
rand lib/rand: Break out random functions into separate package 2016-05-26 07:02:56 +00:00
rc all: Rename LocalVersion to Sequence (fixes #3461) 2016-07-29 19:54:24 +00:00
relay lib/relay: Correctly get IP from remote addr via proxy (fixes #3223) 2016-05-31 14:42:10 +00:00
scanner lib/scanner: Correctly scan symlinks (fixes #3445) 2016-07-26 11:55:25 +00:00
signature The PublicKey() method is an addition in Go 1.4 2015-10-27 16:03:14 +01:00
stats cmd, lib: Fix ineffectual assignments (ineffasign) and comment spelling 2016-07-15 14:23:20 +00:00
symlinks lib/protocol, lib/discover, lib/db: Use protocol buffer serialization (fixes #3080) 2016-07-04 10:40:29 +00:00
sync lib/sync: Skip the timing tests if the host timer is flaky 2016-03-27 10:41:38 +00:00
tlsutil lib/rand: Break out random functions into separate package 2016-05-26 07:02:56 +00:00
upgrade lib/upgrade: Remove TestGithubRelease (fixes #3362) 2016-06-29 19:06:09 +00:00
upnp lib: simplify code 2016-05-18 22:47:11 +00:00
util lib/rand: Break out random functions into separate package 2016-05-26 07:02:56 +00:00
versioner gui: Add addresses for disconnected devices (fixes #3340) 2016-06-26 10:47:23 +00:00