Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Goshimmer_without_tipselection
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
COLLET Ismael
Goshimmer_without_tipselection
Commits
5d5ef57c
Unverified
Commit
5d5ef57c
authored
4 years ago
by
capossele
Browse files
Options
Downloads
Patches
Plain Diff
Fix some bugs
parent
1d57451c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plugins/metrics/fpc.go
+1
-1
1 addition, 1 deletion
plugins/metrics/fpc.go
plugins/metrics/plugin.go
+4
-3
4 additions, 3 deletions
plugins/metrics/plugin.go
with
5 additions
and
4 deletions
plugins/metrics/fpc.go
+
1
−
1
View file @
5d5ef57c
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
plugins/metrics/plugin.go
+
4
−
3
View file @
5d5ef57c
...
@@ -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
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment