Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
15753750
Commit
15753750
authored
May 09, 2023
by
Felipe Andrade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add filtered and total counts
parent
f085d519
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
consensus_poller.go
proxyd/consensus_poller.go
+2
-0
metrics.go
proxyd/metrics.go
+25
-1
No files found.
proxyd/consensus_poller.go
View file @
15753750
...
...
@@ -369,6 +369,8 @@ func (cp *ConsensusPoller) UpdateBackendGroupConsensus(ctx context.Context) {
RecordGroupConsensusLatestBlock
(
cp
.
backendGroup
,
proposedBlock
)
RecordGroupConsensusCount
(
cp
.
backendGroup
,
len
(
consensusBackends
))
RecordGroupConsensusFilteredCount
(
cp
.
backendGroup
,
len
(
filteredBackendsNames
))
RecordGroupTotalCount
(
cp
.
backendGroup
,
len
(
cp
.
backendGroup
.
Backends
))
log
.
Debug
(
"group state"
,
"proposedBlock"
,
proposedBlock
,
"consensusBackends"
,
strings
.
Join
(
consensusBackendsNames
,
", "
),
"filteredBackends"
,
strings
.
Join
(
filteredBackendsNames
,
", "
))
}
...
...
proxyd/metrics.go
View file @
15753750
...
...
@@ -265,7 +265,23 @@ var (
consensusGroupCount
=
promauto
.
NewGaugeVec
(
prometheus
.
GaugeOpts
{
Namespace
:
MetricsNamespace
,
Name
:
"group_consensus_count"
,
Help
:
"Consensus group count"
,
Help
:
"Consensus group serving traffic count"
,
},
[]
string
{
"backend_group_name"
,
})
consensusGroupFilteredCount
=
promauto
.
NewGaugeVec
(
prometheus
.
GaugeOpts
{
Namespace
:
MetricsNamespace
,
Name
:
"group_consensus_filtered_count"
,
Help
:
"Consensus group filtered out from serving traffic count"
,
},
[]
string
{
"backend_group_name"
,
})
consensusGroupTotalCount
=
promauto
.
NewGaugeVec
(
prometheus
.
GaugeOpts
{
Namespace
:
MetricsNamespace
,
Name
:
"group_consensus_total_count"
,
Help
:
"Total count of candidates to be part of consensus group"
,
},
[]
string
{
"backend_group_name"
,
})
...
...
@@ -370,6 +386,14 @@ func RecordGroupConsensusCount(group *BackendGroup, count int) {
consensusGroupCount
.
WithLabelValues
(
group
.
Name
)
.
Set
(
float64
(
count
))
}
func
RecordGroupConsensusFilteredCount
(
group
*
BackendGroup
,
count
int
)
{
consensusGroupFilteredCount
.
WithLabelValues
(
group
.
Name
)
.
Set
(
float64
(
count
))
}
func
RecordGroupTotalCount
(
group
*
BackendGroup
,
count
int
)
{
consensusGroupTotalCount
.
WithLabelValues
(
group
.
Name
)
.
Set
(
float64
(
count
))
}
func
RecordBackendLatestBlock
(
be
*
Backend
,
blockNumber
hexutil
.
Uint64
)
{
backendLatestBlockBackend
.
WithLabelValues
(
be
.
Name
)
.
Set
(
float64
(
blockNumber
))
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment