Skip to content

Commit 6dfd3e0

Browse files
committed
Hard code web limits
1 parent afd5626 commit 6dfd3e0

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

webapi/webapi.go

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"fmt"
77
"log"
88
"net/http"
9-
"strconv"
109
"time"
1110

1211
"github.com/gophergala2016/goad"
@@ -50,26 +49,28 @@ func serveResults(w http.ResponseWriter, r *http.Request) {
5049
return
5150
}
5251

53-
concurrencyStr := r.URL.Query().Get("c")
54-
concurrency, cerr := strconv.Atoi(concurrencyStr)
55-
if cerr != nil {
56-
http.Error(w, "Invalid concurrency", 400)
57-
return
58-
}
59-
60-
totStr := r.URL.Query().Get("tot")
61-
tot, toterr := strconv.Atoi(totStr)
62-
if toterr != nil {
63-
http.Error(w, "Invalid total", 400)
64-
return
65-
}
66-
67-
timeoutStr := r.URL.Query().Get("timeout")
68-
timeout, timeouterr := strconv.Atoi(timeoutStr)
69-
if timeouterr != nil {
70-
http.Error(w, "Invalid timeout", 400)
71-
return
72-
}
52+
// Commented out param handling, we have hard coded limits for the website testing
53+
//
54+
// concurrencyStr := r.URL.Query().Get("c")
55+
// concurrency, cerr := strconv.Atoi(concurrencyStr)
56+
// if cerr != nil {
57+
// http.Error(w, "Invalid concurrency", 400)
58+
// return
59+
// }
60+
//
61+
// totStr := r.URL.Query().Get("tot")
62+
// tot, toterr := strconv.Atoi(totStr)
63+
// if toterr != nil {
64+
// http.Error(w, "Invalid total", 400)
65+
// return
66+
// }
67+
//
68+
// timeoutStr := r.URL.Query().Get("timeout")
69+
// timeout, timeouterr := strconv.Atoi(timeoutStr)
70+
// if timeouterr != nil {
71+
// http.Error(w, "Invalid timeout", 400)
72+
// return
73+
// }
7374

7475
c, err := upgrader.Upgrade(w, r, nil)
7576
if err != nil {
@@ -80,9 +81,9 @@ func serveResults(w http.ResponseWriter, r *http.Request) {
8081

8182
config := goad.TestConfig{
8283
url,
83-
uint(concurrency),
84-
uint(tot),
85-
time.Duration(timeout),
84+
5,
85+
1000,
86+
time.Duration(7),
8687
"eu-west-1",
8788
}
8889

0 commit comments

Comments
 (0)