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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
COLLET Ismael
Goshimmer_without_tipselection
Commits
dd464fb0
Unverified
Commit
dd464fb0
authored
5 years ago
by
Levente Pap
Browse files
Options
Downloads
Patches
Plain Diff
Measure FPC number of currently active conflicts
parent
9ec292ce
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
plugins/metrics/fpc.go
+19
-0
19 additions, 0 deletions
plugins/metrics/fpc.go
plugins/metrics/fpc_test.go
+12
-0
12 additions, 0 deletions
plugins/metrics/fpc_test.go
plugins/metrics/plugin.go
+6
-1
6 additions, 1 deletion
plugins/metrics/plugin.go
with
37 additions
and
1 deletion
plugins/metrics/fpc.go
+
19
−
0
View file @
dd464fb0
package
metrics
import
(
"sync/atomic"
"github.com/iotaledger/goshimmer/packages/vote"
)
var
activeConflicts
uint64
func
processRoundStats
(
stats
vote
.
RoundStats
)
{
// get the number of active conflicts
numActive
:=
(
uint64
)(
len
(
stats
.
ActiveVoteContexts
))
atomic
.
StoreUint64
(
&
activeConflicts
,
numActive
)
}
// ActiveConflicts returns the number of currently active conflicts.
func
ActiveConflicts
()
uint64
{
return
atomic
.
LoadUint64
(
&
activeConflicts
)
}
This diff is collapsed.
Click to expand it.
plugins/metrics/fpc_test.go
+
12
−
0
View file @
dd464fb0
package
metrics
import
(
"testing"
"github.com/magiconair/properties/assert"
)
func
TestActiveConflicts
(
t
*
testing
.
T
)
{
// initialized to 0
assert
.
Equal
(
t
,
ActiveConflicts
(),
(
uint64
)(
0
))
}
This diff is collapsed.
Click to expand it.
plugins/metrics/plugin.go
+
6
−
1
View file @
dd464fb0
...
...
@@ -6,11 +6,11 @@ import (
"github.com/iotaledger/goshimmer/dapps/valuetransfers"
"github.com/iotaledger/goshimmer/dapps/valuetransfers/packages/payload"
valuetangle
"github.com/iotaledger/goshimmer/dapps/valuetransfers/packages/tangle"
"github.com/iotaledger/goshimmer/packages/binary/messagelayer/message"
"github.com/iotaledger/goshimmer/packages/binary/messagelayer/tangle"
"github.com/iotaledger/goshimmer/packages/metrics"
"github.com/iotaledger/goshimmer/packages/shutdown"
"github.com/iotaledger/goshimmer/packages/vote"
"github.com/iotaledger/goshimmer/plugins/messagelayer"
"github.com/iotaledger/hive.go/daemon"
"github.com/iotaledger/hive.go/events"
...
...
@@ -48,6 +48,11 @@ func configure(_ *node.Plugin) {
increaseReceivedTPSCounter
()
}))
// FPC round executed
valuetransfers
.
Voter
()
.
Events
()
.
RoundExecuted
.
Attach
(
events
.
NewClosure
(
func
(
roundStats
vote
.
RoundStats
)
{
processRoundStats
(
roundStats
)
}))
//// Events coming from metrics package ////
metrics
.
Events
()
.
FPCInboundBytes
.
Attach
(
events
.
NewClosure
(
func
(
amountBytes
uint64
)
{
...
...
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