diff options
author | Matthew Holt <[email protected]> | 2019-03-26 19:42:52 -0600 |
---|---|---|
committer | Matthew Holt <[email protected]> | 2019-03-26 19:42:52 -0600 |
commit | a8dc73b4d9db5edf85e78314c9759b9d12a79b71 (patch) | |
tree | c1283aa94e2b2d605985130cdef070a24d03815e /admin_test.go | |
parent | 86e2d1b0a48fbd84590291969611f1870471c3e0 (diff) | |
download | caddy-a8dc73b4d9db5edf85e78314c9759b9d12a79b71.tar.gz caddy-a8dc73b4d9db5edf85e78314c9759b9d12a79b71.zip |
Performance testing Load function
Diffstat (limited to 'admin_test.go')
-rw-r--r-- | admin_test.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/admin_test.go b/admin_test.go new file mode 100644 index 000000000..fe2932cb8 --- /dev/null +++ b/admin_test.go @@ -0,0 +1,30 @@ +package caddy2 + +import ( + "strings" + "testing" +) + +func BenchmarkLoad(b *testing.B) { + for i := 0; i < b.N; i++ { + r := strings.NewReader(`{ + "testval": "Yippee!", + "modules": { + "http": { + "servers": { + "myserver": { + "listen": ["tcp/localhost:8080-8084"], + "read_timeout": "30s" + }, + "yourserver": { + "listen": ["127.0.0.1:5000"], + "read_header_timeout": "15s" + } + } + } + } + } + `) + Load(r) + } +} |