-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Description
General Question
我想在自定义并发测试的Loop中BindJSON,但是好像没有数据
createResp := api_model.CreateObjRespData{} // 响应体
logs.Infof("Begin benchmark....")
Ids = make([]string, C.Number)
filter.NewBench().
Concurrent(C.Concurrent).Number(C.Number).
Loop(func(c *dataflow.Context) error {
c.GET(C.Url + "/api/v1/CreateObj").
SetQuery(NewCreateObjReq()).SetHeader(gout.H{
"x-jwt-token": token,
}).BindJSON(&createResp)
logs.Infof("createResp %+v", createResp) // 打印位置1
Ids = append(Ids, createResp.Id)
return nil
}).Do()
logs.Infof("Resp----%+v", createResp) // 打印位置2示例代码如上,我想把请求返回的数据ID记录下来,不管是在位置1还是位置2都是空的,哪怕我在Loop函数里面执行c.Get.Do()也不行。
Metadata
Metadata
Assignees
Labels
No labels