func beginPage(c *http.Conn, req *http.Request)
{
- header(c);
- io.WriteString(c, "<h1>Starting hammer</h1>");
- //dbhost := req.FormValue("dbhost");
- //dbuser := req.FormValue("dbuser");
- //dbpass := req.FormValue("dbpass");
- //dbname := req.FormValue("dbname");
- //nthreads := req.FormValue("nthreads");
- //dbmult := req.FormValue("dbmult");
-
- footer(c);
+
+ if req.Method != "GET" {
+ http.Redirect(c, "/begin", 301);
+ } else {
+ header(c);
+ io.WriteString(c, "<h1>Starting hammer</h1>");
+ //dbhost := req.FormValue("dbhost");
+ //dbuser := req.FormValue("dbuser");
+ //dbpass := req.FormValue("dbpass");
+ //dbname := req.FormValue("dbname");
+ //nthreads := req.FormValue("nthreads");
+ //dbmult := req.FormValue("dbmult");
+
+ footer(c);
+ }
}
dbname := req.FormValue("dbname");
nthreads := req.FormValue("nthreads");
dbmult := req.FormValue("dbmult");
+ var dbtype string;
io.WriteString(c, "You are trying to perform a benchmark with the following values:<br>");
io.WriteString(c, "<table border=\"1\">");
io.WriteString(c, "<input type=\"submit\" name=\"Begin\" value=\"Begin\">");
io.WriteString(c, "</form>");
+ dbtype = "mysql";
+
footer(c);
- comout <- fmt.Sprintf("configure:%s:%s:%s:%s:%s:%s", dbhost, dbuser, dbpass, dbname, dbmult, nthreads);
+ comout <- fmt.Sprintf("configure:%s:%s:%s:%s:%s:%s:%s", dbtype, dbhost, dbuser, dbpass, dbname, dbmult, nthreads);
}