示例#1
0
func (self *Server) EvtLoop() {
	tick := time.NewTicker(1 * time.Second)
	for {
		select {
		case e := <-self.protoEvtCh:
			self.handleProtoEvt(e)
		case e := <-self.ctrlEvtCh:
			self.handleCtrlEvt(e)
		case <-tick.C:
			self.pubCounter()
			stats.PubInt("len(protoEvtCh)", len(self.protoEvtCh))
			stats.PubInt("worker count", len(self.worker))
			stats.PubInt("job queue length", len(self.jobs))
			stats.PubInt("queue count", len(self.funcWorker))
			stats.PubInt("client count", len(self.client))
			stats.PubInt64("forwardReport", self.forwardReport)
		}
	}
}
示例#2
0
func (self *Server) pubCounter() {
	for k, v := range self.opCounter {
		stats.PubInt64(CmdDescription(k), v)
	}
}