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


Golang pct.NewSyncChan函数代码示例

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


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

示例1: NewWaitTicker

func NewWaitTicker(atInterval uint) *WaitTicker {
	wt := &WaitTicker{
		atInterval: atInterval,
		sync:       pct.NewSyncChan(),
	}
	return wt
}
开发者ID:hg3rdrock,项目名称:percona-agent,代码行数:7,代码来源:wait.go

示例2: NewMockIntervalIter

func NewMockIntervalIter(intervalChan chan *qan.Interval) *MockIntervalIter {
	iter := &MockIntervalIter{
		intervalChan:     make(chan *qan.Interval),
		testIntervalChan: intervalChan,
		sync:             pct.NewSyncChan(),
	}
	return iter
}
开发者ID:huangzhiyong,项目名称:percona-agent,代码行数:8,代码来源:interval_iter.go

示例3: 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

示例4: NewEvenTicker

func NewEvenTicker(atInterval uint, sleep func(time.Duration)) *EvenTicker {
	et := &EvenTicker{
		atInterval: atInterval,
		sleep:      sleep,
		watcher:    make(map[chan time.Time]bool),
		watcherMux: new(sync.Mutex),
		sync:       pct.NewSyncChan(),
	}
	return et
}
开发者ID:hg3rdrock,项目名称:percona-agent,代码行数:10,代码来源:ticker.go

示例5: NewIter

func NewIter(logger *pct.Logger, tickChan chan time.Time) *Iter {
	iter := &Iter{
		logger:   logger,
		tickChan: tickChan,
		// --
		intervalChan: make(chan *qan.Interval, 1),
		sync:         pct.NewSyncChan(),
	}
	return iter
}
开发者ID:hg3rdrock,项目名称:percona-agent,代码行数:10,代码来源:iter.go

示例6: NewIter

func NewIter(intervalChan chan *qan.Interval) *Iter {
	iter := &Iter{
		testIntervalChan: intervalChan,
		// --
		intervalChan: make(chan *qan.Interval, 1),
		sync:         pct.NewSyncChan(),
		tickChan:     make(chan time.Time),
		calls:        []string{},
	}
	return iter
}
开发者ID:hg3rdrock,项目名称:percona-agent,代码行数:11,代码来源:interval_iter.go

示例7: 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

示例8: NewAggregator

func NewAggregator(logger *pct.Logger, interval int64, collectionChan chan *Collection, spool data.Spooler) *Aggregator {
	a := &Aggregator{
		logger:         logger,
		interval:       interval,
		collectionChan: collectionChan,
		spool:          spool,
		// --
		sync: pct.NewSyncChan(),
	}
	return a
}
开发者ID:hg3rdrock,项目名称:percona-agent,代码行数:11,代码来源:aggregator.go

示例9: NewFileIntervalIter

func NewFileIntervalIter(logger *pct.Logger, filename FilenameFunc, tickChan chan time.Time) *FileIntervalIter {
	iter := &FileIntervalIter{
		logger:   logger,
		filename: filename,
		tickChan: tickChan,
		// --
		intervalChan: make(chan *Interval, 1),
		running:      false,
		sync:         pct.NewSyncChan(),
	}
	return iter
}
开发者ID:huangzhiyong,项目名称:percona-agent,代码行数:12,代码来源:interval.go

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: 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

示例15: 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


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