mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-09 14:41:02 +00:00
Add request method to stats
This commit is contained in:
parent
da04eb7bc3
commit
363a19b321
1 changed files with 3 additions and 1 deletions
|
|
@ -241,7 +241,7 @@ func (h *Handler) collectStats(next http.Handler) http.Handler {
|
|||
next.ServeHTTP(w, r)
|
||||
dur := time.Since(t)
|
||||
|
||||
statsTags := make([]string, 0, 4)
|
||||
statsTags := make([]string, 0, 5)
|
||||
|
||||
longQueryTime := h.api.LongQueryTime()
|
||||
if longQueryTime > 0 && dur > longQueryTime {
|
||||
|
|
@ -261,6 +261,8 @@ func (h *Handler) collectStats(next http.Handler) http.Handler {
|
|||
statsTags = append(statsTags, "path:"+path)
|
||||
}
|
||||
|
||||
statsTags = append(statsTags, "method:"+r.Method)
|
||||
|
||||
stats := h.api.StatsWithTags(statsTags)
|
||||
if stats != nil {
|
||||
stats.Timing("http.request", dur, 0.1)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue