stat.go 510 B

12345678910111213141516171819202122232425
  1. package stat
  2. import (
  3. "go-common/library/stat/prom"
  4. )
  5. // Stat interface.
  6. type Stat interface {
  7. Timing(name string, time int64, extra ...string)
  8. Incr(name string, extra ...string) // name,ext...,code
  9. State(name string, val int64, extra ...string)
  10. }
  11. // default stat struct.
  12. var (
  13. // http
  14. HTTPClient Stat = prom.HTTPClient
  15. HTTPServer Stat = prom.HTTPServer
  16. // storage
  17. Cache Stat = prom.LibClient
  18. DB Stat = prom.LibClient
  19. // rpc
  20. RPCClient Stat = prom.RPCClient
  21. RPCServer Stat = prom.RPCServer
  22. )