X-Git-Url: http://git.pjr.cc/?p=goDBhammer.git;a=blobdiff_plain;f=src%2Fwebconnector.go;h=1f83b293f76c1cc7b848c4655e0a52b3cfb5205a;hp=a579966fc6cef1ed31a630a0f10759735d5fff86;hb=aa53e90426fd1929ce0add86389a43394b5116f8;hpb=b349b3785350a2295c0252eac5ac46987744c1ae diff --git a/src/webconnector.go b/src/webconnector.go index a579966..1f83b29 100644 --- a/src/webconnector.go +++ b/src/webconnector.go @@ -24,8 +24,8 @@ func ServerResponder(c *http.Conn, req *http.Request) { mainPage(c, req); } - if req.RawURL == "/setup" { - setupPage(c, req); + if req.RawURL == "/confirm" { + confirmPage(c, req); } // fucking go, i just wanna consume the incoming data, but it forces me to do something with it... cunt of a language @@ -33,10 +33,27 @@ func ServerResponder(c *http.Conn, req *http.Request) { //fmt.Printf("%d\n", k); } -func setupPage(c *http.Conn, req *http.Request) +func confirmPage(c *http.Conn, req *http.Request) { header(c); - io.WriteString(c, "I am a setup page"); + io.WriteString(c, "

Confirm

"); + dbhost := req.FormValue("dbhost"); + dbuser := req.FormValue("dbuser"); + dbpass := req.FormValue("dbpass"); + dbname := req.FormValue("dbname"); + nthreads := req.FormValue("nthreads"); + + io.WriteString(c, "You are trying to perform a benchmark with the following values:
"); + io.WriteString(c, ""); + io.WriteString(c, fmt.Sprintf("", dbhost)); + io.WriteString(c, fmt.Sprintf("", dbuser)); + io.WriteString(c, fmt.Sprintf("", dbpass)); + io.WriteString(c, fmt.Sprintf("", dbname)); + io.WriteString(c, fmt.Sprintf("", nthreads)); + io.WriteString(c, "
Host%s
User%s
Password%s
Database%s
Number of Threads%s
"); + io.WriteString(c, "Back"); + io.WriteString(c, fmt.Sprintf(" Begin", dbhost, dbuser, dbpass, dbname, nthreads)); + footer(c); } @@ -45,8 +62,9 @@ func mainPage(c *http.Conn, req *http.Request) header(c); io.WriteString(c, "

goDBHammer


"); io.WriteString(c, "Welcome to goDBHammer, the go based database benchmarking tool
"); - io.WriteString(c, "
"); - io.WriteString(c, ""); + io.WriteString(c, ""); + io.WriteString(c, "
Database Host
"); + io.WriteString(c, ""); io.WriteString(c, ""); io.WriteString(c, ""); io.WriteString(c, ""); @@ -68,16 +86,8 @@ func footer(c *http.Conn) io.WriteString(c, ""); } -func main() { - - //var Dbconn *dbibridge.DBIConnection; - - //Dbconn = dbibridge.DBICreate(); - - //dbibridge.DBIConnect(Dbconn, "mysql", "localhost", "root", "password", "zm"); - //dbibridge.ExecSQL(Dbconn, "create table asdf (asdf int)"); - //dbibridge.DBIDisconnect(Dbconn); - +func main() +{ comin = make(chan int); comout = make(chan int);
Database Type
Database Host
Database User
Database Password
Database