the way i'm doing the web itnerface kinda sucks.
[goDBhammer.git] / src / benchcontroller.go
1 // the benchmark controller
2
3 package benchcontroller
4
5 import (
6         //"./dbconnector";
7         "fmt";
8         "time";
9 )
10
11 type BenchControllerConfig struct {
12         id int;
13         nclients int;
14         dbtype string;
15         dbhost string;
16         dbuser string;
17         dbpass string;
18         dbname string;
19 }
20
21 func CreateController()(contConfig *BenchControllerConfig)
22 {
23         bcConfig := new(BenchControllerConfig);
24         
25         return bcConfig;
26 }
27
28 func MainLoop(conf *BenchControllerConfig, commInChan chan string, commOutChan chan string)
29 {
30         for {
31                 time.Sleep(1000000000);
32                 i := <-commInChan;
33                 
34                 fmt.Printf("coms: %s\n", i);
35                 
36                 /*switch i {
37                         case 1:
38                                 // this means shutdown
39                                 os.Stdout.WriteString("shutdown\n");
40                                 return;
41                         case 2:
42                                 // get ready to bench - start the clients
43                                 os.Stdout.WriteString("ready clients\n");
44                         case 3:
45                                 // start the clients
46                                 os.Stdout.WriteString("start clients\n");
47                 }*/
48         }
49 }