mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2025-01-03 09:17:38 +00:00
add rpc method request gauge
This commit is contained in:
parent
894b1e3c8d
commit
5bd73320ba
@ -340,6 +340,7 @@ func (h *handler) handleCall(cp *callProc, msg *jsonrpcMessage) *jsonrpcMessage
|
||||
successfulRequestGauge.Inc(1)
|
||||
}
|
||||
rpcServingTimer.UpdateSince(start)
|
||||
newRPCRequestGauge(msg.Method).Inc(1)
|
||||
newRPCServingTimer(msg.Method, answer.Error == nil).UpdateSince(start)
|
||||
}
|
||||
return answer
|
||||
|
@ -37,3 +37,8 @@ func newRPCServingTimer(method string, valid bool) metrics.Timer {
|
||||
m := fmt.Sprintf("rpc/duration/%s/%s", method, flag)
|
||||
return metrics.GetOrRegisterTimer(m, nil)
|
||||
}
|
||||
|
||||
func newRPCRequestGauge(method string) metrics.Gauge {
|
||||
m := fmt.Sprintf("rpc/count/%s", method)
|
||||
return metrics.GetOrRegisterGauge(m, nil)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user