本文整理汇总了Golang中goshawkdb/io/server.StatusConsumer.Fork方法的典型用法代码示例。如果您正苦于以下问题:Golang StatusConsumer.Fork方法的具体用法?Golang StatusConsumer.Fork怎么用?Golang StatusConsumer.Fork使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类goshawkdb/io/server.StatusConsumer
的用法示例。
在下文中一共展示了StatusConsumer.Fork方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: 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()
}
示例2: 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()
}
示例3: 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()
}
示例4: Status
func (vm *VarManager) Status(sc *server.StatusConsumer) {
sc.Emit(fmt.Sprintf("- Active Vars: %v", len(vm.active)))
sc.Emit(fmt.Sprintf("- Callbacks: %v", len(vm.callbacks)))
sc.Emit(fmt.Sprintf("- Beater live? %v", vm.beaterLive))
for _, v := range vm.active {
v.Status(sc.Fork())
}
sc.Join()
}
示例5: 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()
}
示例6: 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()
}
示例7: 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()
}
示例8: Status
func (am *AcceptorManager) Status(sc *server.StatusConsumer) {
s := sc.Fork()
s.Emit(fmt.Sprintf("- Live Instances: %v", len(am.instances)))
for instId, inst := range am.instances {
inst.status(instId, s.Fork())
}
s.Join()
s = sc.Fork()
s.Emit(fmt.Sprintf("- Acceptors: %v", len(am.acceptors)))
for _, aInst := range am.acceptors {
if acc := aInst.acceptor; acc != nil {
acc.Status(s.Fork())
}
}
s.Join()
sc.Join()
}
示例9: status
func (lc *LocalConnection) status(sc *server.StatusConsumer) {
sc.Emit("LocalConnection")
lc.submitter.Status(sc.Fork())
sc.Join()
}