1 // the benchmark controller
3 package benchcontroller
13 type BenchControllerConfig struct {
24 func CreateController()(contConfig *BenchControllerConfig)
26 bcConfig := new(BenchControllerConfig);
31 func MainLoop(conf *BenchControllerConfig, commInChan chan string, commOutChan chan string)
36 fmt.Printf("coms: %s\n", i);
38 calls := strings.Split(i, ":", 0);
40 fmt.Printf("stuff 1: %s, stuff 2: %s\n", calls[0], calls[1]);
44 // this means shutdown
45 os.Stdout.WriteString("time for a conf\n");
51 conf.nclients, esink = strconv.Atoi(calls[7]);
52 conf.datamult, esink = strconv.Atoi(calls[6]);
54 if esink != os.ECHILD {
55 // i need to do something with esink or the bollocks compiler screws itself
57 conf.dbtype = calls[1];
58 conf.dbhost = calls[2];
59 conf.dbuser = calls[3];
60 conf.dbpass = calls[4];
61 conf.dbname = calls[5];
64 // get ready to bench - start the clients
65 os.Stdout.WriteString("ready clients\n");
67 comchan := make(chan int);
71 go dbconnector.DBSetup("mysql", conf.dbhost, conf.dbuser, conf.dbpass, conf.dbname, conf.datamult, comchan);
76 fmt.Printf("val: %d\n", val);
82 os.Stdout.WriteString("ok, im done\n");
85 os.Stdout.WriteString("start clients\n");