当前位置: 首页>>代码示例>>Golang>>正文


Golang pct.NewStatus函数代码示例

本文整理汇总了Golang中github.com/percona/percona-agent/pct.NewStatus函数的典型用法代码示例。如果您正苦于以下问题:Golang NewStatus函数的具体用法?Golang NewStatus怎么用?Golang NewStatus使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了NewStatus函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: NewSlowLogWorker

func NewSlowLogWorker(logger *pct.Logger, name string) *SlowLogWorker {
	w := &SlowLogWorker{
		logger: logger,
		name:   name,
		status: pct.NewStatus([]string{name}),
	}
	return w
}
开发者ID:huangzhiyong,项目名称:percona-agent,代码行数:8,代码来源:worker.go

示例2: NewMockServiceManager

func NewMockServiceManager(name string, readyChan chan bool, traceChan chan string) *MockServiceManager {
	m := &MockServiceManager{
		name:      name,
		readyChan: readyChan,
		traceChan: traceChan,
		status:    pct.NewStatus([]string{name}),
	}
	return m
}
开发者ID:huangzhiyong,项目名称:percona-agent,代码行数:9,代码来源:service.go

示例3: NewManager

func NewManager(logger *pct.Logger, monitor Monitor) *Manager {
	m := &Manager{
		logger:  logger,
		monitor: monitor,
		// --
		status: pct.NewStatus([]string{SERVICE_NAME}),
	}
	return m
}
开发者ID:hg3rdrock,项目名称:percona-agent,代码行数:9,代码来源:manager.go

示例4: NewSender

func NewSender(logger *pct.Logger, client pct.WebsocketClient) *Sender {
	s := &Sender{
		logger: logger,
		client: client,
		sync:   pct.NewSyncChan(),
		status: pct.NewStatus([]string{"data-sender"}),
	}
	return s
}
开发者ID:huangzhiyong,项目名称:percona-agent,代码行数:9,代码来源:sender.go

示例5: NewManager

func NewManager(logger *pct.Logger, configDir string, api pct.APIConnector) *Manager {
	repo := NewRepo(pct.NewLogger(logger.LogChan(), "instance-repo"), configDir, api)
	m := &Manager{
		logger:    logger,
		configDir: configDir,
		// --
		status: pct.NewStatus([]string{"instance", "instance-repo"}),
		repo:   repo,
	}
	return m
}
开发者ID:huangzhiyong,项目名称:percona-agent,代码行数:11,代码来源:manager.go

示例6: NewSender

func NewSender(logger *pct.Logger, client pct.WebsocketClient) *Sender {
	s := &Sender{
		logger:     logger,
		client:     client,
		sync:       pct.NewSyncChan(),
		status:     pct.NewStatus([]string{"data-sender", "data-sender-last", "data-sender-1d"}),
		lastStats:  NewSenderStats(0),
		dailyStats: NewSenderStats(24 * time.Hour),
	}
	return s
}
开发者ID:hg3rdrock,项目名称:percona-agent,代码行数:11,代码来源:sender.go

示例7: NewMonitor

func NewMonitor(name string, config *Config, logger *pct.Logger, conn mysql.Connector) *Monitor {
	m := &Monitor{
		name:   name,
		config: config,
		logger: logger,
		conn:   conn,
		// --
		sync:   pct.NewSyncChan(),
		status: pct.NewStatus([]string{name, name + "-mysql"}),
	}
	return m
}
开发者ID:hg3rdrock,项目名称:percona-agent,代码行数:12,代码来源:monitor.go

示例8: NewDiskvSpooler

func NewDiskvSpooler(logger *pct.Logger, dataDir string, hostname string) *DiskvSpooler {
	s := &DiskvSpooler{
		logger:   logger,
		dataDir:  dataDir,
		hostname: hostname,
		// --
		dataChan: make(chan *proto.Data, WRITE_BUFFER),
		sync:     pct.NewSyncChan(),
		status:   pct.NewStatus([]string{"data-spooler"}),
		mux:      new(sync.Mutex),
	}
	return s
}
开发者ID:huangzhiyong,项目名称:percona-agent,代码行数:13,代码来源:spooler.go

示例9: NewMonitor

func NewMonitor(name string, config *Config, logger *pct.Logger) *Monitor {
	m := &Monitor{
		name:   name,
		config: config,
		logger: logger,
		// --
		prevCPUval: make(map[string][]float64),
		prevCPUsum: make(map[string]float64),
		status:     pct.NewStatus([]string{name}),
		sync:       pct.NewSyncChan(),
	}
	return m
}
开发者ID:hg3rdrock,项目名称:percona-agent,代码行数:13,代码来源:monitor.go

示例10: NewMonitor

func NewMonitor(logger *pct.Logger, mysqlConnFactory mysql.ConnectionFactory) mrms.Monitor {
	m := &Monitor{
		logger:           logger,
		mysqlConnFactory: mysqlConnFactory,
		// --
		mysqlInstances: make(map[string]*MysqlInstance),
		// --
		status:     pct.NewStatus([]string{MONITOR_NAME}),
		sync:       pct.NewSyncChan(),
		globalChan: make(chan string, 100),
	}
	return m
}
开发者ID:hg3rdrock,项目名称:percona-agent,代码行数:13,代码来源:monitor.go

示例11: NewDiskvSpooler

func NewDiskvSpooler(logger *pct.Logger, dataDir, trashDir, hostname string, limits proto.DataSpoolLimits) *DiskvSpooler {
	s := &DiskvSpooler{
		logger:   logger,
		dataDir:  dataDir,
		trashDir: trashDir,
		hostname: hostname,
		limits:   limits,
		// --
		dataChan: make(chan *proto.Data, DEFAULT_DATA_MAX_FILES),
		sync:     pct.NewSyncChan(),
		status:   pct.NewStatus([]string{"data-spooler", "data-spooler-count", "data-spooler-size", "data-spooler-oldest"}),
		mux:      new(sync.Mutex),
		fileSize: make(map[string]int),
	}
	return s
}
开发者ID:hg3rdrock,项目名称:percona-agent,代码行数:16,代码来源:spooler.go

示例12: NewAgent

func NewAgent(config *Config, logger *pct.Logger, api pct.APIConnector, client pct.WebsocketClient, services map[string]pct.ServiceManager) *Agent {
	agent := &Agent{
		config:    config,
		api:       api,
		configMux: &sync.RWMutex{},
		logger:    logger,
		client:    client,
		services:  services,
		updater:   pct.NewUpdater(logger, api, pct.PublicKey, os.Args[0], VERSION),
		// --
		status:     pct.NewStatus([]string{"agent", "agent-cmd-handler"}),
		cmdChan:    make(chan *proto.Cmd, CMD_QUEUE_SIZE),
		statusChan: make(chan *proto.Cmd, STATUS_QUEUE_SIZE),
	}
	return agent
}
开发者ID:hg3rdrock,项目名称:percona-agent,代码行数:16,代码来源:agent.go

示例13: NewWebsocketClient

func NewWebsocketClient(logger *pct.Logger, api pct.APIConnector, link string) (*WebsocketClient, error) {
	name := logger.Service()
	c := &WebsocketClient{
		logger: logger,
		api:    api,
		link:   link,
		// --
		conn:        nil,
		recvChan:    make(chan *proto.Cmd, RECV_BUFFER_SIZE),
		sendChan:    make(chan *proto.Reply, SEND_BUFFER_SIZE),
		connectChan: make(chan bool, 1),
		errChan:     make(chan error, 2),
		backoff:     pct.NewBackoff(5 * time.Minute),
		sendSync:    pct.NewSyncChan(),
		recvSync:    pct.NewSyncChan(),
		mux:         new(sync.Mutex),
		name:        name,
		status:      pct.NewStatus([]string{name, name + "-link"}),
	}
	return c, nil
}
开发者ID:huangzhiyong,项目名称:percona-agent,代码行数:21,代码来源:ws.go

示例14: NewRealAnalyzer

func NewRealAnalyzer(logger *pct.Logger, config Config, iter IntervalIter, mysqlConn mysql.Connector, restartChan <-chan bool, worker Worker, clock ticker.Manager, spool data.Spooler) *RealAnalyzer {
	name := logger.Service()
	a := &RealAnalyzer{
		logger:      logger,
		config:      config,
		iter:        iter,
		mysqlConn:   mysqlConn,
		restartChan: restartChan,
		worker:      worker,
		clock:       clock,
		spool:       spool,
		// --
		name:                name,
		mysqlConfiguredChan: make(chan bool, 1),
		workerDoneChan:      make(chan *Interval, 1),
		status:              pct.NewStatus([]string{name, name + "-last-interval", name + "-next-interval"}),
		runSync:             pct.NewSyncChan(),
		configureMySQLSync:  pct.NewSyncChan(),
		mux:                 &sync.RWMutex{},
	}
	return a
}
开发者ID:hg3rdrock,项目名称:percona-agent,代码行数:22,代码来源:analyzer.go

示例15: NewRelay

func NewRelay(client pct.WebsocketClient, logChan chan *proto.LogEntry, logFile string, logLevel byte, offline bool) *Relay {
	r := &Relay{
		client:   client,
		logChan:  logChan,
		logFile:  logFile,
		logLevel: logLevel,
		offline:  offline,
		// --
		logLevelChan: make(chan byte),
		logFileChan:  make(chan string),
		firstBuf:     make([]*proto.LogEntry, BUFFER_SIZE),
		secondBuf:    make([]*proto.LogEntry, BUFFER_SIZE),
		status: pct.NewStatus([]string{
			"log-relay",
			"log-file",
			"log-level",
			"log-chan",
			"log-buf1",
			"log-buf2",
		}),
	}
	return r
}
开发者ID:huangzhiyong,项目名称:percona-agent,代码行数:23,代码来源:relay.go


注:本文中的github.com/percona/percona-agent/pct.NewStatus函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。