--- /dev/null
+so our program should work pretty simple
+
+execution:
+goDBHammer port
+
+where port is the port it'll listen to web requests for
+
+
+there will be two very simple executions in that interface
+
+1 controls the benchmark
+2 is for rpc
+
+this means you'll login to some controller and then tell it to connect to another controller on whatever port was used;
+
+for eg:
+
+machine 1: # godbhammer 12345
+machine 2: # godbhammer 12345
+
+on webpage of machine 1: # add machine2:12345
+
+then machine 1 controls machine 2's hammer
+
+The bits needed:
+
+rpc class (server/client)
+web class (server)
+id generator (one thread)
+benchmark controller (one thread)
+benchmark clients (one thread each) - the things actually running the benchmark
+
+dbi connector class.
\ No newline at end of file
--- /dev/null
+package benchclient
+
+// this package is a single benchmark client, i.e. a worker
+
+import "dbconnector";
+
+var myID int;
+
+func Setup(ID int)
+{
+ myID = ID;
+
+ if myID == 1 {
+ // create the db
+ }
+}
+
+func Begin()
+{
+ // start the test
+
+ // first, populate data for pre-run
+ // this will mean creating x number of rows of data depending on input
+
+ // now, run the test
+ // the test will be insert, drop, update, select queries across multiple tables
+}
+
+func End()
+{
+ // the main controller said CEASE!
+}
\ No newline at end of file
-// um yes... its a db connector
\ No newline at end of file
+// um yes... its a db connector
+package dbconnector
+
+type DBConnector struct {
+ // err, yes
+}
+
+func DBSetup(dbtype string, host string, username string, password string, database string, createtables bool)
+{
+
+ // the job of this function is to bring up the connection and create tables based on dbtype
+
+}
+
+
+
"unsafe";
)
-type DBConnection struct {
+type DBIConnection struct {
dbconn C.dbi_conn;
dbinit bool;
}
return dbCon;
}
-//func (thisDBConn *DBConnection)DBIConnect(dbtype string, host string, username string, password string, database string)
+//func (thisDBConn *DBIConnection)DBIConnect(dbtype string, host string, username string, password string, database string)
// for some reason, the above doesnt work how i'd expect..
-func DBIConnect(thisDBConn *DBConnection, dbtype string, host string, username string, password string, database string)
+func DBIConnect(thisDBConn *DBIConnection, dbtype string, host string, username string, password string, database string)
{
C.dbi_initialize(nil);
thisDBConn.dbinit = true;
}
-func ExecSQL(thisDBConn *DBConnection, SQL string)
+func ExecSQL(thisDBConn *DBIConnection, SQL string)
{
C.dbi_conn_query((unsafe.Pointer)(thisDBConn.dbconn), C.CString(SQL));
}
-func DBIDisconnect(thisDBConn *DBConnection)
+func DBIDisconnect(thisDBConn *DBIConnection)
{
C.dbi_conn_close((unsafe.Pointer)(thisDBConn.dbconn));
}
\ No newline at end of file
gopack grc dbibridge.a _dbibridge_.8 dbibridge.cgo3.8
#cp dbibridge.a /export/src/external/golang//pkg/linux_386/dbibridge.a
gcc -m32 -fPIC -O2 -o dbibridge.cgo4.o -c dbibridge.cgo4.c
-gcc -m32 -shared -lpthread -lm -ldbi -o dbibridge.so dbibridge.cgo4.o
-cp dbibridge.so /export/src/external/golang//pkg/linux_386/./dbibridge_dbibridge.so
+gcc -m32 -shared -L`pwd` -lpthread -lm -ldbi -o dbibridge_dbibridge.so dbibridge.cgo4.o
+#cp dbibridge.so /export/src/external/golang//pkg/linux_386/./dbibridge_dbibridge.so
8g -I. webconnector.go
-8l -L. webconnector.8
+8l -o godhammer -L. webconnector.8
func main() {
- var Dbconn *dbibridge.DBConnection;
+ var Dbconn *dbibridge.DBIConnection;
Dbconn = dbibridge.DBICreate();