Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

25
library/stat/stat.go Normal file
View File

@@ -0,0 +1,25 @@
package stat
import (
"go-common/library/stat/prom"
)
// Stat interface.
type Stat interface {
Timing(name string, time int64, extra ...string)
Incr(name string, extra ...string) // name,ext...,code
State(name string, val int64, extra ...string)
}
// default stat struct.
var (
// http
HTTPClient Stat = prom.HTTPClient
HTTPServer Stat = prom.HTTPServer
// storage
Cache Stat = prom.LibClient
DB Stat = prom.LibClient
// rpc
RPCClient Stat = prom.RPCClient
RPCServer Stat = prom.RPCServer
)