本文整理汇总了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
}
示例2: NewMockIntervalIter
func NewMockIntervalIter(intervalChan chan *qan.Interval) *MockIntervalIter {
iter := &MockIntervalIter{
intervalChan: make(chan *qan.Interval),
testIntervalChan: intervalChan,
sync: pct.NewSyncChan(),
}
return iter
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}