Skip to content

Commit

Permalink
modify comment
Browse files Browse the repository at this point in the history
  • Loading branch information
bugVanisher committed May 8, 2020
1 parent c15c8b2 commit 2313089
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
File renamed without changes.
11 changes: 6 additions & 5 deletions examples/rpc/main.go → examples/grpc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

var verbose = false

// 修改为要压测的服务接口
// change to your own service and method
var service = "helloworld.Greeter"
var method = "SayHello"
var timeout uint = 3000
Expand All @@ -28,11 +28,11 @@ var (
func rpcReq() {
startTime := time.Now()

// 构建请求对象
// make the request
request := &HelloRequest{}
request.Name = req.Name

// 初始化响应对象
// init the response
resp := new(HelloReply)
err := client.Call(request, resp)

Expand All @@ -44,7 +44,7 @@ func rpcReq() {
}
boomer.RecordFailure("rpc", "error", 0.0, err.Error())
} else {
// 添加自定义断言
// make your assertion
boomer.RecordSuccess("rpc", "succ",
elapsed.Nanoseconds()/int64(time.Millisecond), int64(len(resp.String())))
if verbose {
Expand All @@ -64,14 +64,15 @@ func main() {
flag.Parse()

log.Printf(reqJSONStr)
// json反序列化
// json unserialize, input different parameters
err := json.Unmarshal([]byte(reqJSONStr), &req)

if nil != err {
log.Printf("json unmarshal error")
return
}

// init requester
client = grequester.NewRequester(addr, service, method, timeout, poolsize)

task := &boomer.Task{
Expand Down

0 comments on commit 2313089

Please sign in to comment.