trace api: add call stats to trace (#7915)

Stats such as call latency, bytes received and sent have been added
This commit is contained in:
poornas
2019-07-18 15:29:17 -07:00
committed by kannappanr
parent fbfc9a61ec
commit 041a812ba0
2 changed files with 50 additions and 18 deletions

View File

@@ -24,10 +24,18 @@ import (
// Info - represents a trace record, additionally
// also reports errors if any while listening on trace.
type Info struct {
NodeName string `json:"nodename"`
FuncName string `json:"funcname"`
ReqInfo RequestInfo `json:"request"`
RespInfo ResponseInfo `json:"response"`
NodeName string `json:"nodename"`
FuncName string `json:"funcname"`
ReqInfo RequestInfo `json:"request"`
RespInfo ResponseInfo `json:"response"`
CallStats CallStats `json:"stats"`
}
// CallStats records request stats
type CallStats struct {
InputBytes int `json:"inputbytes"`
OutputBytes int `json:"outputbytes"`
Latency time.Duration `json:"latency"`
}
// RequestInfo represents trace of http request