package benchcontroller
import (
- //"./dbconnector";
+ "./dbconnector";
"fmt";
- "time";
"strings";
"strconv";
"os";
func MainLoop(conf *BenchControllerConfig, commInChan chan string, commOutChan chan string)
{
for {
- time.Sleep(1000000000);
i := <-commInChan;
fmt.Printf("coms: %s\n", i);
conf.dbpass = calls[4];
conf.dbname = calls[5];
- case "asdf":
+ case "begin":
// get ready to bench - start the clients
os.Stdout.WriteString("ready clients\n");
+
+ comchan := make(chan int);
+ var cont bool;
+
+
+ go dbconnector.DBSetup("mysql", conf.dbhost, conf.dbuser, conf.dbpass, conf.dbname, conf.datamult, comchan);
+ cont=true;
+
+ for cont{
+ val := <- comchan;
+ fmt.Printf("val: %d\n", val);
+ if val == 100 {
+ cont = false;
+ }
+ }
+
+ os.Stdout.WriteString("ok, im done\n");
case "qwer":
// start the clients
os.Stdout.WriteString("start clients\n");