예제 #1
0
파일: balancer.go 프로젝트: xianxu/rpcx
func NewBasicStatsReporter(stats gostrich.Stats) *BasicStatsReporter {
	return &BasicStatsReporter{
		counterReq:     stats.Counter("req"),
		counterSucc:    stats.Counter("req/success"),
		counterFail:    stats.Counter("req/fail"),
		reqLatencyStat: stats.Statistics("req/latency"),
		counterRspNil:  stats.Counter("rsp/nil"),
	}
}
예제 #2
0
파일: httpservice.go 프로젝트: xianxu/tfe
func NewHttpStatsReporter(stats gostrich.Stats) *HttpStatsReporter {
	return &HttpStatsReporter{
		counterReq:     stats.Counter("req"),
		counterSucc:    stats.Counter("req/success"),
		counterFail:    stats.Counter("req/fail"),
		reqLatencyStat: stats.Statistics("req/latency"),

		sizeStat:          stats.Statistics("rsp/size"),
		counterRspNil:     stats.Counter("rsp/nil"),
		counterRspTypeErr: stats.Counter("rsp/type_err"),
		counter1xx:        stats.Counter("rsp/1xx"),
		size1xx:           stats.Statistics("rsp_size/1xx"),
		counter2xx:        stats.Counter("rsp/2xx"),
		size2xx:           stats.Statistics("rsp_size/2xx"),
		counter3xx:        stats.Counter("rsp/3xx"),
		size3xx:           stats.Statistics("rsp_size/3xx"),
		counter4xx:        stats.Counter("rsp/4xx"),
		size4xx:           stats.Statistics("rsp_size/4xx"),
		counter5xx:        stats.Counter("rsp/5xx"),
		size5xx:           stats.Statistics("rsp_size/5xx"),
		counterRst:        stats.Counter("rsp/rst"),
		sizeRst:           stats.Statistics("rsp_size/rst"),
	}
}