因为看不到你的 task 是怎么写的,你可以在这个位置加个日志,看看上报给 master 的数据是怎样的。
data := s.collectReportData()
这个是在你说的位置加了日志,我把整个data输出
消息上报的我直接用了例子sample里面提供的
boomer.RecordSuccess("tcp", "sendMsg", elapsed.Nanoseconds()/int64(time.Millisecond), int64(10))
在locust的web端点击了停止,这个消息还是会继续上报,等上报两条后,我ctrl+c终止了boomer程序。
这次我统计的请求次数是372,locust统计的是121
deviceTime: 1606223193, success msg index: 372 elapsed: 15.054208ms
2020/11/24 21:06:45 map[errors:map[] stats:[map[last_request_timestamp:1606223204 max_response_time:28 method:tcp min_response_time:13 name:sendMsg num_fail_per_sec:map[] num_failures:0 num_none_requests:0 num_reqs_per_sec:map[1606223202:7 1606223203:134 1606223204:110] num_requests:251 response_times:map[13:15 14:60 15:171 16:2 25:2 28:1] st