summaryrefslogtreecommitdiffhomepage
path: root/admin_test.go
diff options
context:
space:
mode:
authorMatthew Holt <[email protected]>2019-03-26 19:42:52 -0600
committerMatthew Holt <[email protected]>2019-03-26 19:42:52 -0600
commita8dc73b4d9db5edf85e78314c9759b9d12a79b71 (patch)
treec1283aa94e2b2d605985130cdef070a24d03815e /admin_test.go
parent86e2d1b0a48fbd84590291969611f1870471c3e0 (diff)
downloadcaddy-a8dc73b4d9db5edf85e78314c9759b9d12a79b71.tar.gz
caddy-a8dc73b4d9db5edf85e78314c9759b9d12a79b71.zip
Performance testing Load function
Diffstat (limited to 'admin_test.go')
-rw-r--r--admin_test.go30
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)
+ }
+}