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
b8331022
Unverified
Commit
b8331022
authored
4 years ago
by
capossele
Browse files
Options
Downloads
Patches
Plain Diff
WIP
parent
46e28b7f
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/prometheus/info.go
+1
-15
1 addition, 15 deletions
plugins/prometheus/info.go
plugins/prometheus/metrics.go
+19
-0
19 additions, 0 deletions
plugins/prometheus/metrics.go
with
20 additions
and
15 deletions
plugins/prometheus/info.go
+
1
−
15
View file @
b8331022
...
...
@@ -6,8 +6,7 @@ import (
)
var
(
infoApp
*
prometheus
.
GaugeVec
infoTips
prometheus
.
Gauge
infoApp
*
prometheus
.
GaugeVec
)
func
init
()
{
...
...
@@ -18,18 +17,5 @@ func init() {
},
[]
string
{
"name"
,
"version"
},
)
infoTips
=
prometheus
.
NewGauge
(
prometheus
.
GaugeOpts
{
Name
:
"iota_info_tips"
,
Help
:
"Number of tips."
,
})
infoApp
.
WithLabelValues
(
banner
.
AppName
,
banner
.
AppVersion
)
.
Set
(
1
)
registry
.
MustRegister
(
infoApp
)
registry
.
MustRegister
(
infoTips
)
addCollect
(
collectInfo
)
}
func
collectInfo
()
{
// Tips
infoTips
.
Set
(
0
)
}
This diff is collapsed.
Click to expand it.
plugins/prometheus/metrics.go
+
19
−
0
View file @
b8331022
package
prometheus
import
(
"github.com/iotaledger/goshimmer/dapps/valuetransfers"
"github.com/iotaledger/goshimmer/plugins/messagelayer"
"github.com/iotaledger/goshimmer/plugins/metrics"
"github.com/prometheus/client_golang/prometheus"
)
var
(
messagesPerSecond
prometheus
.
Gauge
infoMessageTips
prometheus
.
Gauge
infoValueTips
prometheus
.
Gauge
)
func
init
()
{
...
...
@@ -14,12 +18,27 @@ func init() {
Name
:
"iota_messages_per_second"
,
Help
:
"Number of messages per second."
,
})
infoMessageTips
=
prometheus
.
NewGauge
(
prometheus
.
GaugeOpts
{
Name
:
"iota_info_message_tips"
,
Help
:
"Number of message tips."
,
})
infoValueTips
=
prometheus
.
NewGauge
(
prometheus
.
GaugeOpts
{
Name
:
"iota_info_value_tips"
,
Help
:
"Number of value tips."
,
})
registry
.
MustRegister
(
messagesPerSecond
)
registry
.
MustRegister
(
infoApp
)
registry
.
MustRegister
(
infoMessageTips
)
addCollect
(
collectMetrics
)
}
func
collectMetrics
()
{
// MPS
messagesPerSecond
.
Set
(
float64
(
metrics
.
ReceivedMessagesPerSecond
()))
// Tips
infoMessageTips
.
Set
(
float64
(
messagelayer
.
TipSelector
.
TipCount
()))
infoValueTips
.
Set
(
float64
(
valuetransfers
.
TipManager
()
.
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