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
This commit is contained in:
Jesús Espino
2019-09-24 20:00:19 +02:00
committed by Miguel de la Cruz
parent f257109953
commit 99f13ed0e6
2 changed files with 904 additions and 1356 deletions

View File

@@ -246,14 +246,13 @@ func (s *{{$.Name}}{{$substoreName}}Store) {{$index}}({{$element.Params | joinPa
{{ else }}
{{$element.Results | genResultsVars}} := s.{{$substoreName}}Store.{{$index}}({{$element.Params | joinParams}})
{{ end }}
t := timemodule.Now()
elapsed := t.Sub(start)
elapsed := float64(timemodule.Since(start)) / float64(timemodule.Second)
if s.Root.Metrics != nil {
success := "false"
if {{$element.Results | errorToBoolean}} {
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}}
}

File diff suppressed because it is too large Load Diff