mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
rpc: a bit less metrics allocations (#8084)
This commit is contained in:
parent
f5cc67fe5b
commit
ddf608f866
@ -28,10 +28,8 @@ var (
|
||||
)
|
||||
|
||||
func newRPCServingTimerMS(method string, valid bool) *metrics.Summary {
|
||||
flag := "success"
|
||||
if !valid {
|
||||
flag = "failure"
|
||||
if valid {
|
||||
return metrics.GetOrCreateSummary(fmt.Sprintf(`rpc_duration_seconds{method="%s",success="success"}`, method))
|
||||
}
|
||||
m := fmt.Sprintf(`rpc_duration_seconds{method="%s",success="%s"}`, method, flag)
|
||||
return metrics.GetOrCreateSummary(m)
|
||||
return metrics.GetOrCreateSummary(fmt.Sprintf(`rpc_duration_seconds{method="%s",success="failure"}`, method))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user