本文整理汇总了Golang中goshawkdb/io/server.StatusConsumer.Emit方法的典型用法代码示例。如果您正苦于以下问题:Golang StatusConsumer.Emit方法的具体用法?Golang StatusConsumer.Emit怎么用?Golang StatusConsumer.Emit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类goshawkdb/io/server.StatusConsumer
的用法示例。
在下文中一共展示了StatusConsumer.Emit方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Status
func (sts *SimpleTxnSubmitter) Status(sc *server.StatusConsumer) {
txnIds := make([]common.TxnId, 0, len(sts.outcomeConsumers))
for txnId := range sts.outcomeConsumers {
txnIds = append(txnIds, txnId)
}
sc.Emit(fmt.Sprintf("SimpleTxnSubmitter: live TxnIds: %v", txnIds))
sc.Join()
}
示例2: Status
func (pm *ProposerManager) Status(sc *server.StatusConsumer) {
sc.Emit(fmt.Sprintf("Live proposers: %v", len(pm.proposers)))
for _, prop := range pm.proposers {
prop.Status(sc.Fork())
}
sc.Emit(fmt.Sprintf("Live proposals: %v", len(pm.proposals)))
for _, prop := range pm.proposals {
prop.Status(sc.Fork())
}
sc.Join()
}
示例3: status
func (i *instance) status(instId instanceId, sc *server.StatusConsumer) {
sc.Emit(instId.String())
sc.Emit(fmt.Sprintf("- Promise Number: %v", i.promiseNum))
sc.Emit(fmt.Sprintf("- Accepted Number: %v", i.acceptedNum))
sc.Emit(fmt.Sprintf("- Accepted Ballot: %v", i.accepted))
sc.Join()
}
示例4: Status
func (a *Acceptor) Status(sc *server.StatusConsumer) {
sc.Emit(fmt.Sprintf("Acceptor for %v", a.txnId))
sc.Emit(fmt.Sprintf("- Current State: %v", a.currentState))
sc.Emit(fmt.Sprintf("- Outcome determined? %v", a.outcome != nil))
sc.Emit(fmt.Sprintf("- Pending TLC: %v", a.pendingTLC))
a.ballotAccumulator.Status(sc.Fork())
sc.Join()
}
示例5: status
func (conn *Connection) status(sc *server.StatusConsumer) {
sc.Emit(fmt.Sprintf("Connection to %v (%v, %v)", conn.remoteHost, conn.remoteRMId, conn.remoteBootCount))
sc.Emit(fmt.Sprintf("- Current State: %v", conn.currentState))
sc.Emit(fmt.Sprintf("- Established? %v", conn.established))
sc.Emit(fmt.Sprintf("- IsServer? %v", conn.isServer))
sc.Emit(fmt.Sprintf("- IsClient? %v", conn.isClient))
if conn.submitter != nil {
conn.submitter.Status(sc.Fork())
}
sc.Join()
}
示例6: Status
func (oa *OutcomeAccumulator) Status(sc *server.StatusConsumer) {
outcomeToAcceptors := make(map[*txnOutcome][]common.RMId)
acceptors := make([]common.RMId, 0, len(oa.acceptorIdToTxnOutcome))
for rmId, outcome := range oa.acceptorIdToTxnOutcome {
acceptors = append(acceptors, rmId)
if list, found := outcomeToAcceptors[outcome]; found {
outcomeToAcceptors[outcome] = append(list, rmId)
} else {
outcomeToAcceptors[outcome] = []common.RMId{rmId}
}
}
sc.Emit(fmt.Sprintf("- known outcomes from acceptors: %v", acceptors))
sc.Emit(fmt.Sprintf("- unique outcomes: %v", outcomeToAcceptors))
sc.Emit(fmt.Sprintf("- outcome decided? %v", oa.decidingOutcome != nil))
sc.Emit(fmt.Sprintf("- pending TGCs from: %v", oa.pendingTGC))
sc.Join()
}
示例7: status
func (lc *LocalConnection) status(sc *server.StatusConsumer) {
sc.Emit("LocalConnection")
lc.submitter.Status(sc.Fork())
sc.Join()
}
示例8: Status
func (v *Var) Status(sc *server.StatusConsumer) {
sc.Emit(v.UUId.String())
if v.positions == nil {
sc.Emit("- Positions: unknown")
} else {
sc.Emit(fmt.Sprintf("- Positions: %v", v.positions))
}
sc.Emit("- CurFrame:")
v.curFrame.Status(sc.Fork())
sc.Emit(fmt.Sprintf("- Subscribers: %v", len(v.subscribers)))
sc.Emit(fmt.Sprintf("- Idle? %v", v.isIdle()))
sc.Join()
}
示例9: Status
func (f *frame) Status(sc *server.StatusConsumer) {
sc.Emit(f.String())
readHistogram := make([]int, 4)
for node := f.reads.First(); node != nil; node = node.Next() {
readHistogram[int(node.Value.(txnStatus))]++
}
writeHistogram := make([]int, 4)
for node := f.writes.First(); node != nil; node = node.Next() {
writeHistogram[int(node.Value.(txnStatus))]++
}
sc.Emit(fmt.Sprintf("- Read Count: %v %v", f.reads.Len(), readHistogram))
sc.Emit(fmt.Sprintf("- Uncommitted Read Count: %v", f.uncommittedReads))
sc.Emit(fmt.Sprintf("- Learnt future reads: %v", len(f.learntFutureReads)))
sc.Emit(fmt.Sprintf("- Write Count: %v %v", f.writes.Len(), writeHistogram))
sc.Emit(fmt.Sprintf("- Uncommitted Write Count: %v", f.uncommittedWrites))
sc.Emit(fmt.Sprintf("- RW Present: %v", f.rwPresent))
sc.Emit(fmt.Sprintf("- Mask: %v", f.mask))
sc.Emit(fmt.Sprintf("- Current State: %v", f.currentState))
sc.Emit(fmt.Sprintf("- Locked? %v", f.isLocked()))
sc.Emit(fmt.Sprintf("- Roll scheduled/active? %v/%v", f.rollScheduled, f.rollActive))
sc.Emit(fmt.Sprintf("- DescendentOnDisk? %v", f.onDisk))
sc.Emit(fmt.Sprintf("- Child == nil? %v", f.child == nil))
sc.Emit(fmt.Sprintf("- Parent == nil? %v", f.parent == nil))
if f.parent != nil {
f.parent.Status(sc.Fork())
}
sc.Join()
}
示例10: Status
func (p *Proposer) Status(sc *server.StatusConsumer) {
sc.Emit(fmt.Sprintf("Proposer for %v", p.txnId))
sc.Emit(fmt.Sprintf("- Mode: %v", p.mode))
sc.Emit(fmt.Sprintf("- Current state: %v", p.currentState))
sc.Emit("- Outcome Accumulator")
p.outcomeAccumulator.Status(sc.Fork())
sc.Emit(fmt.Sprintf("- Locally Complete? %v", p.locallyCompleted))
if p.txn != nil {
sc.Emit("- Txn")
p.txn.Status(sc.Fork())
}
sc.Join()
}
示例11: status
func (cm *ConnectionManager) status(sc *server.StatusConsumer) {
sc.Emit(fmt.Sprintf("Address: %v", cm.localHost))
sc.Emit(fmt.Sprintf("Boot Count: %v", cm.BootCount))
sc.Emit(fmt.Sprintf("Current Topology: %v", cm.topology))
serverConnections := make([]string, 0, len(cm.servers))
for server := range cm.servers {
serverConnections = append(serverConnections, server)
}
sc.Emit(fmt.Sprintf("Senders: %v", len(cm.senders)))
rms := make([]common.RMId, 0, len(cm.rmToServer))
for rmId := range cm.rmToServer {
rms = append(rms, rmId)
}
sc.Emit(fmt.Sprintf("Active Server RMIds: %v", rms))
sc.Emit(fmt.Sprintf("Active Server Connections: %v", serverConnections))
sc.Emit(fmt.Sprintf("Desired Server Connections: %v", cm.desired))
for _, conn := range cm.servers {
conn.Status(sc.Fork())
}
sc.Emit(fmt.Sprintf("Client Connection Count: %v", len(cm.connCountToClient)))
cm.connCountToClient[0].(*client.LocalConnection).Status(sc.Fork())
for _, conn := range cm.connCountToClient {
if c, ok := conn.(*Connection); ok {
c.Status(sc.Fork())
}
}
cm.Dispatchers.VarDispatcher.Status(sc.Fork())
cm.Dispatchers.ProposerDispatcher.Status(sc.Fork())
cm.Dispatchers.AcceptorDispatcher.Status(sc.Fork())
sc.Join()
}