mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-28 22:39:05 +08:00
use milliseconds in prometheus observation
This commit is contained in:
2
main.go
2
main.go
@@ -92,7 +92,7 @@ func setupMetrics() *metrics {
|
||||
// recordDuration records the length of a request from start to now
|
||||
func (m metrics) recordDuration(start time.Time, name string) {
|
||||
elapsed := time.Since(start)
|
||||
m.responseTimes.WithLabelValues(name).Observe(float64(elapsed.Nanoseconds()))
|
||||
m.responseTimes.WithLabelValues(name).Observe(float64(elapsed.Milliseconds()))
|
||||
log.Printf("Served %s in %s", name, elapsed)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user