Checkpoint
This commit is contained in:
19
proxy/stats.go
Normal file
19
proxy/stats.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package proxy
|
||||
|
||||
import (
|
||||
"expvar"
|
||||
"strconv"
|
||||
|
||||
"git.maze.io/maze/styx/db/stats"
|
||||
)
|
||||
|
||||
func countStatus(code int) {
|
||||
k := "http:status:" + strconv.Itoa(code)
|
||||
v := expvar.Get(k)
|
||||
if v == nil {
|
||||
//v = stats.NewCounter("120s1s", "15m10s", "1h1m", "4w1d", "1y4w")
|
||||
v = stats.NewCounter(k, stats.Minutely, stats.Hourly, stats.Daily, stats.Yearly)
|
||||
expvar.Publish(k, v)
|
||||
}
|
||||
v.(stats.Metric).Add(1)
|
||||
}
|
Reference in New Issue
Block a user