X-Git-Url: http://git.pjr.cc/?p=goDBhammer.git;a=blobdiff_plain;f=src%2Fbenchcontroller.go;h=bb49570d5b8532171a9ad13359a42105c9b2c124;hp=579edcb8bbf11d75aa9dfffffa9b49e874e7c20b;hb=b349b3785350a2295c0252eac5ac46987744c1ae;hpb=87ec29face97b3bce825a0b14aa3199bf9852604 diff --git a/src/benchcontroller.go b/src/benchcontroller.go index 579edcb..bb49570 100644 --- a/src/benchcontroller.go +++ b/src/benchcontroller.go @@ -10,6 +10,12 @@ import ( type BenchControllerConfig struct { id int; + nclients int; + dbtype string; + dbhost string; + dbuser string; + dbpass string; + dbname string; } func CreateController()(contConfig *BenchControllerConfig) @@ -25,7 +31,18 @@ func MainLoop(conf *BenchControllerConfig, commInChan chan int, commOutChan chan time.Sleep(1000000000); i := <-commInChan; os.Stdout.WriteString("got a coms\n"); - commOutChan <- i; - os.Stdout.WriteString("Send some back\n"); + + switch i { + case 1: + // this means shutdown + os.Stdout.WriteString("shutdown\n"); + return; + case 2: + // get ready to bench - start the clients + os.Stdout.WriteString("ready clients\n"); + case 3: + // start the clients + os.Stdout.WriteString("start clients\n"); + } } } \ No newline at end of file