syncthing/test
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
..
h1 cmd/syncthing, lib/config: Enable HTTP CPU/heap profile collection for users 2016-08-02 11:06:45 +00:00
h2 cmd/syncthing, lib/config: Enable HTTP CPU/heap profile collection for users 2016-08-02 11:06:45 +00:00
h3 cmd/syncthing, lib/config: Enable HTTP CPU/heap profile collection for users 2016-08-02 11:06:45 +00:00
h4 cmd/syncthing, lib/config: Enable HTTP CPU/heap profile collection for users 2016-08-02 11:06:45 +00:00
logs Improvements to integration tests 2015-01-22 00:18:08 +00:00
.gitignore Add devices without restart (fixes #2083) 2015-07-22 10:43:47 +02:00
cli_test.go mv internal lib 2015-08-09 09:35:26 +02:00
conflict_test.go Use pause/resume device to ensure TestConflictsDefault can run 2015-11-17 13:32:57 +01:00
delay_scan_test.go Refactored integration tests 2015-06-19 08:47:47 +02:00
filetype_test.go Fix import paths 2015-09-22 19:38:46 +02:00
http_test.go Add a CORS handler to deal with preflight OPTIONS requests 2016-01-26 21:55:51 +01:00
httpstress_test.go Refactored integration tests 2015-06-19 08:47:47 +02:00
ignore_test.go Correctly handle (?i) in ignores (fixes #1953) 2015-09-02 21:12:41 +02:00
manypeers_test.go Fix import paths 2015-09-22 19:38:46 +02:00
norestart_test.go Fix import paths 2015-09-22 19:38:46 +02:00
override_test.go lib/config: Change folder type attribute to a FolderType type 2016-05-04 11:26:36 +00:00
parallell_scan_test.go Refactored integration tests 2015-06-19 08:47:47 +02:00
reconnect_test.go Refactored integration tests 2015-06-19 08:47:47 +02:00
reset_test.go This unexpected EOF is really quite expected 2015-09-24 14:19:21 +02:00
scan_test.go Fix typo introduced 2015-10-25 21:10:55 +00:00
symlink_test.go lib/model: Refactor out scanning method from rwfolder.Serve loop 2016-03-30 06:53:47 +00:00
sync_test.go Handle sparse files (fixes #245) 2015-11-21 17:58:09 +01:00
transfer-bench_test.go cmd, lib: Fix ineffectual assignments (ineffasign) and comment spelling 2016-07-15 14:23:20 +00:00
util.go lib/model: Refactor out scanning method from rwfolder.Serve loop 2016-03-30 06:53:47 +00:00