Documentation
¶
Index ¶
Constants ¶
const ( MaxIntInFloat = float64(math.MaxInt64) // assume the platform supports MaxUintInFloat = float64(math.MaxUint64) )
const ( LoadPhase exePhase = "load" RunPhase = "run" DoRead genSig = "read" DoWrite = "write" NormalExit exeSig = "exit" // followed by a return ErrorExit = "exception" // followed by a return GnfStop = "stop" // never followed by a return BmkStop = "bmStop" // never followed by a return CtrlLoad = "load" CtrlRun = "run" Ready = "ready" // for two comm threads only )
const Letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
Variables ¶
This section is empty.
Functions ¶
func EncodeBmStat ¶
func GnfMain ¶
func GnfMain() error
gnf main method parses command line argument and spawns one of the two gnfs: gnf: gnf with controller, need to specify controller ip, nf port and stat port gnf-cli: gnf without controller, need to specify load/run phase and workload file
returns some_error_with_msg if there's an exception or nil if everything works as intended
Types ¶
type BmStats ¶
type BmStats struct {
IP string
Timestamp string // e.g. get from time.Now().String()
Runtime float64
Throughput float64
SRead int
SReadAvgLat float64
SRead95pLat float64
SWrite int
SWriteAvgLat float64
SWrite95pLat float64
FRead int
FReadAvgLat float64
FRead95pLat float64
FWrite int
FWriteAvgLat float64
FWrite95pLat float64
}
TODO: change the name to StatsMsg from statistics thread to executor then to pub thread / print out
func DecodeBmStat ¶
type OpGenerator ¶
type OpGenerator interface {
/*
exit condition: receive from exeToGen OR offered operation keys required by the workload
upon exit: it closes genToCli channel
upon exception: no known possible exception, no exception signal
*/
GenThread(allToExe chan<- exeCmd, exeToGen <-chan bool, genToCli chan<- genCmd, wl *Workload, phase exePhase)
}
type RedisClient ¶
type UniformOpGenerator ¶
type UniformOpGenerator struct {
}
func (*UniformOpGenerator) GenThread ¶
func (gen *UniformOpGenerator) GenThread(allToExe chan<- exeCmd, exeToGen <-chan bool, genToCli chan<- genCmd, wl *Workload, phase exePhase)
type Workload ¶
type Workload struct {
RemoteDB string
RemoteDBHost string
RemoteDBPort int
RemoteDBPassword string
RemoteDBLoadThreadCount int
RemoteDBRunThreadCount int
RemoteDBInsertKeyRange keyRanges
RemoteDBInsertValueSizeInByte int
RemoteDBOperationCount int
RemoteDBOperationRange keyRanges
RemoteDBOperationDistribution string
RemoteDBGlobalMaximumKeyIndex int // not in use for now
RemoteDBReadRatio float64
RemoteDBWriteRatio float64
}
func InitWorkload ¶
func InitWorkload() *Workload
func (*Workload) UpdateWorkloadByFile ¶
return -1 if there's an exception (no workload file found) or a updateCount, could >= 0, if the workload object is updated
func (*Workload) UpdateWorkloadByLine ¶
Update a workload parameter by feeding a line that looks like param=value if found no update: return 0, nil; if found one update: return 1, nil; if found an ill update (found a field but unsuitable value): return -1, some_error_message
type ZipfianOpGenerator ¶
type ZipfianOpGenerator struct {
}
func (*ZipfianOpGenerator) GenThread ¶
func (gen *ZipfianOpGenerator) GenThread(allToExe chan<- exeCmd, exeToGen <-chan bool, genToCli chan<- genCmd, wl *Workload, phase exePhase)