add standalone benchmark server
This commit is contained in:
Родитель
0f85408fd4
Коммит
9f83f476dc
|
@ -0,0 +1,22 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"math"
|
||||
"time"
|
||||
|
||||
"google.golang.org/grpc/benchmark"
|
||||
)
|
||||
|
||||
var (
|
||||
duration = flag.Int("duration", math.MaxInt32, "The duration in seconds to run the benchmark server")
|
||||
)
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
addr, stopper := benchmark.StartServer()
|
||||
fmt.Println("Server Address: ", addr)
|
||||
<-time.After(time.Duration(*duration) * time.Second)
|
||||
stopper()
|
||||
}
|
Загрузка…
Ссылка в новой задаче