mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
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:
committed by
Miguel de la Cruz
parent
f257109953
commit
99f13ed0e6
@@ -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}}
|
||||
}
|
||||
|
||||
2255
store/timer_layer.go
2255
store/timer_layer.go
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user