Skip to content
Snippets Groups Projects
Unverified Commit 5d5ef57c authored by capossele's avatar capossele
Browse files

:bug: Fix some bugs

parent 1d57451c
No related branches found
No related tags found
No related merge requests found
...@@ -70,7 +70,7 @@ func FPCOpinionQueryReplyErrors() uint64 { ...@@ -70,7 +70,7 @@ func FPCOpinionQueryReplyErrors() uint64 {
//// logic broken into "process..." functions to be able to write unit tests //// //// logic broken into "process..." functions to be able to write unit tests ////
func processRoundStats(stats vote.RoundStats) { func processRoundStats(stats *vote.RoundStats) {
// get the number of active conflicts // get the number of active conflicts
numActive := (uint64)(len(stats.ActiveVoteContexts)) numActive := (uint64)(len(stats.ActiveVoteContexts))
atomic.StoreUint64(&activeConflicts, numActive) atomic.StoreUint64(&activeConflicts, numActive)
......
...@@ -32,6 +32,9 @@ var log *logger.Logger ...@@ -32,6 +32,9 @@ var log *logger.Logger
func configure(_ *node.Plugin) { func configure(_ *node.Plugin) {
log = logger.NewLogger(PluginName) log = logger.NewLogger(PluginName)
}
func run(_ *node.Plugin) {
//// Events declared in other packages which we want to listen to here //// //// Events declared in other packages which we want to listen to here ////
...@@ -52,7 +55,7 @@ func configure(_ *node.Plugin) { ...@@ -52,7 +55,7 @@ func configure(_ *node.Plugin) {
})) }))
// FPC round executed // FPC round executed
valuetransfers.Voter().Events().RoundExecuted.Attach(events.NewClosure(func(roundStats vote.RoundStats) { valuetransfers.Voter().Events().RoundExecuted.Attach(events.NewClosure(func(roundStats *vote.RoundStats) {
processRoundStats(roundStats) processRoundStats(roundStats)
})) }))
...@@ -107,9 +110,7 @@ func configure(_ *node.Plugin) { ...@@ -107,9 +110,7 @@ func configure(_ *node.Plugin) {
metrics.Events().QueryReplyError.Attach(events.NewClosure(func(ev *metrics.QueryReplyErrorEvent) { metrics.Events().QueryReplyError.Attach(events.NewClosure(func(ev *metrics.QueryReplyErrorEvent) {
processQueryReplyError(ev) processQueryReplyError(ev)
})) }))
}
func run(_ *node.Plugin) {
// create a background worker that "measures" the MPS value every second // create a background worker that "measures" the MPS value every second
if err := daemon.BackgroundWorker("Metrics Updater", func(shutdownSignal <-chan struct{}) { if err := daemon.BackgroundWorker("Metrics Updater", func(shutdownSignal <-chan struct{}) {
timeutil.Ticker(func() { timeutil.Ticker(func() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment