Пример #1
0
func RegisterUpdateStreamService(mycnf *Mycnf) {
	if UpdateStreamRpcService != nil {
		//log.Warningf("Update Stream service already initialized")
		return
	}

	UpdateStreamRpcService = &UpdateStream{mycnf: mycnf}
	UpdateStreamRpcService.states = estats.NewStates("", []string{
		"Disabled",
		"Enabled",
	}, time.Now(), DISABLED)
	rpcwrap.RegisterAuthenticated(UpdateStreamRpcService)
	estats.PublishFunc("UpdateStreamRpcService", func() string { return UpdateStreamRpcService.statsJSON() })
}
Пример #2
0
func NewSqlQuery(config Config) *SqlQuery {
	sq := &SqlQuery{}
	sq.qe = NewQueryEngine(config)
	sq.states = stats.NewStates("", []string{
		stateName[NOT_SERVING],
		stateName[CLOSED],
		stateName[CONNECTING],
		stateName[ABORT],
		stateName[INITIALIZING],
		stateName[OPEN],
		stateName[SHUTTING_DOWN],
	}, time.Now(), NOT_SERVING)
	stats.PublishFunc("Voltron", func() string { return sq.statsJSON() })
	return sq
}
Пример #3
0
func NewZkReader(resolveLocal bool, preload []string) *ZkReader {
	zkr := &ZkReader{zcell: make(map[string]*zkCell), resolveLocal: resolveLocal}
	if resolveLocal {
		zkr.localCell = zk.GuessLocalCell()
	}

	stats.PublishFunc("ZkReader", func() string { return zkr.statsJSON() })

	// start some cells
	for _, cellName := range preload {
		_, path, err := zkr.getCell("/zk/" + cellName)
		if err != nil {
			log.Errorf("Cell " + cellName + " could not be preloaded: " + err.Error())
		} else {
			log.Infof("Cell " + cellName + " preloaded for: " + path)
		}
	}
	return zkr
}
Пример #4
0
func RegisterBinlogPlayerMap(blm *BinlogPlayerMap) {
	stats.PublishFunc("BinlogPlayerMap", func() string { return blm.statsJSON() })
}
Пример #5
0
// RegisterBinlogServerService registers the service for serving and stats.
func RegisterBinlogServerService(blServer *BinlogServer) {
	rpcwrap.RegisterAuthenticated(blServer)
	estats.PublishFunc("BinlogServerRpcService", func() string { return blServer.statsJSON() })
}