Example #1
0
func main() {
	flag.Parse()
	hosts = strings.Split(*host, ",", -1)
	rand.Seed(time.Nanoseconds())
	go keeper()
	for i := 0; i < getters*(*n); i++ {
		go loop(get, getDelay)
	}
	for i := 0; i < posters*(*n); i++ {
		go loop(post, postDelay)
	}
	stat.Process = "!bench"
	stat.Monitor(*statServer)
}
Example #2
0
File: main.go Project: rsec/goto
func main() {
	flag.Parse()
	if *masterAddr != "" {
		store = NewProxyStore(*masterAddr)
	} else {
		store = NewURLStore(*dataFile)
	}
	if *rpcEnabled {
		rpc.RegisterName("Store", store)
		rpc.HandleHTTP()
	}
	stat.Process = *listenAddr
	go stat.Monitor(*statServer)
	http.HandleFunc("/", Redirect)
	http.HandleFunc("/add", Add)
	http.ListenAndServe(*listenAddr, nil)

}