the way i'm doing the web itnerface kinda sucks.
[goDBhammer.git] / src / benchcontroller.go
index e69de29..6bd48a3 100644 (file)
@@ -0,0 +1,49 @@
+// the benchmark controller
+
+package benchcontroller
+
+import (
+       //"./dbconnector";
+       "fmt";
+       "time";
+)
+
+type BenchControllerConfig struct {
+       id int;
+       nclients int;
+       dbtype string;
+       dbhost string;
+       dbuser string;
+       dbpass string;
+       dbname string;
+}
+
+func CreateController()(contConfig *BenchControllerConfig)
+{
+       bcConfig := new(BenchControllerConfig);
+       
+       return bcConfig;
+}
+
+func MainLoop(conf *BenchControllerConfig, commInChan chan string, commOutChan chan string)
+{
+       for {
+               time.Sleep(1000000000);
+               i := <-commInChan;
+               
+               fmt.Printf("coms: %s\n", i);
+               
+               /*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