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
866f09e9
Commit
866f09e9
authored
4 years ago
by
Levente Pap
Browse files
Options
Downloads
Patches
Plain Diff
New metric MessageRequestQueueSize
parent
d5cb2150
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/metrics/message.go
+13
-0
13 additions, 0 deletions
plugins/metrics/message.go
with
13 additions
and
0 deletions
plugins/metrics/message.go
+
13
−
0
View file @
866f09e9
...
@@ -26,6 +26,9 @@ var (
...
@@ -26,6 +26,9 @@ var (
// protect map from concurrent read/write.
// protect map from concurrent read/write.
messageCountPerPayloadMutex
syncutils
.
RWMutex
messageCountPerPayloadMutex
syncutils
.
RWMutex
// number of messages being requested by the message layer.
requestQueueSize
atomic
.
Int64
)
)
////// Exported functions to obtain metrics from outside //////
////// Exported functions to obtain metrics from outside //////
...
@@ -54,6 +57,11 @@ func MessageTips() uint64 {
...
@@ -54,6 +57,11 @@ func MessageTips() uint64 {
return
messageTips
.
Load
()
return
messageTips
.
Load
()
}
}
// MessageRequestQueueSize returns the number of message requests the node currently has registered.
func
MessageRequestQueueSize
()
int64
{
return
requestQueueSize
.
Load
()
}
////// Handling data updates and measuring //////
////// Handling data updates and measuring //////
func
increasePerPayloadCounter
(
p
payload
.
Type
)
{
func
increasePerPayloadCounter
(
p
payload
.
Type
)
{
...
@@ -93,3 +101,8 @@ func measureReceivedMPS() {
...
@@ -93,3 +101,8 @@ func measureReceivedMPS() {
// trigger events for outside listeners
// trigger events for outside listeners
Events
.
ReceivedMPSUpdated
.
Trigger
(
sampledMPS
)
Events
.
ReceivedMPSUpdated
.
Trigger
(
sampledMPS
)
}
}
func
measureRequestQueueSize
()
{
size
:=
int64
(
messagelayer
.
MessageRequester
()
.
RequestQueueSize
())
requestQueueSize
.
Store
(
size
)
}
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