Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PLUGIN = node.NewPlugin("Statusscreen TPS", node.Enabled, func(plugin *node.Plugin) { gossip.Events.TransactionReceived.Attach(events.NewClosure(func(_ *gossip.TransactionReceivedEvent) { atomic.AddUint64(&receivedTpsCounter, 1) })) tangle.Events.TransactionSolid.Attach(events.NewClosure(func(_ *value_transaction.ValueTransaction) { atomic.AddUint64(&solidTpsCounter, 1) })) statusscreen.AddHeaderInfo(func() (s string, s2 string) { return "TPS", strconv.FormatUint(atomic.LoadUint64(&receivedTps), 10) + " received / " + strconv.FormatUint(atomic.LoadUint64(&solidTps), 10) + " new" }) }, func(plugin *node.Plugin) { daemon.BackgroundWorker("Statusscreen TPS Tracker", func(shutdownSignal <-chan struct{}) { ticker := time.NewTicker(time.Second) for { select { case <-shutdownSignal: return case <-ticker.C: atomic.StoreUint64(&receivedTps, atomic.LoadUint64(&receivedTpsCounter)) atomic.StoreUint64(&solidTps, atomic.LoadUint64(&solidTpsCounter)) atomic.StoreUint64(&receivedTpsCounter, 0) atomic.StoreUint64(&solidTpsCounter, 0) } } }, shutdown.ShutdownPriorityStatusScreen) })
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.