Use seconds instead of nanoseconds for the store time layer metrics (#12321)
* Use nanoseconds instead of seconds for the api metrics * Using seconds instead of nanoseconds in the store layer metrics
Этот коммит содержится в:
коммит произвёл
Miguel de la Cruz
родитель
f257109953
Коммит
99f13ed0e6
@@ -246,14 +246,13 @@ func (s *{{$.Name}}{{$substoreName}}Store) {{$index}}({{$element.Params | joinPa
|
|||||||
{{ else }}
|
{{ else }}
|
||||||
{{$element.Results | genResultsVars}} := s.{{$substoreName}}Store.{{$index}}({{$element.Params | joinParams}})
|
{{$element.Results | genResultsVars}} := s.{{$substoreName}}Store.{{$index}}({{$element.Params | joinParams}})
|
||||||
{{ end }}
|
{{ end }}
|
||||||
t := timemodule.Now()
|
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
|
||||||
elapsed := t.Sub(start)
|
|
||||||
if s.Root.Metrics != nil {
|
if s.Root.Metrics != nil {
|
||||||
success := "false"
|
success := "false"
|
||||||
if {{$element.Results | errorToBoolean}} {
|
if {{$element.Results | errorToBoolean}} {
|
||||||
success = "true"
|
success = "true"
|
||||||
}
|
}
|
||||||
s.Root.Metrics.ObserveStoreMethodDuration("{{$substoreName}}Store.{{$index}}", success, float64(elapsed))
|
s.Root.Metrics.ObserveStoreMethodDuration("{{$substoreName}}Store.{{$index}}", success, elapsed)
|
||||||
}
|
}
|
||||||
return {{$element.Results | genResultsVars}}
|
return {{$element.Results | genResultsVars}}
|
||||||
}
|
}
|
||||||
|
|||||||
2255
store/timer_layer.go
2255
store/timer_layer.go
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Ссылка в новой задаче
Block a user