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
52779a2b
Unverified
Commit
52779a2b
authored
Apr 12, 2023
by
OptimismBot
Committed by
GitHub
Apr 12, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5404 from ethereum-optimism/inphi/batch-metric
op-batcher: Add Channel Bytes Counters
parents
60453e22
62fe3f62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
metrics.go
op-batcher/metrics/metrics.go
+20
-6
No files found.
op-batcher/metrics/metrics.go
View file @
52779a2b
...
@@ -58,12 +58,14 @@ type Metrics struct {
...
@@ -58,12 +58,14 @@ type Metrics struct {
PendingBlocksCount
prometheus
.
GaugeVec
PendingBlocksCount
prometheus
.
GaugeVec
BlocksAddedCount
prometheus
.
Gauge
BlocksAddedCount
prometheus
.
Gauge
ChannelInputBytes
prometheus
.
GaugeVec
ChannelInputBytes
prometheus
.
GaugeVec
ChannelReadyBytes
prometheus
.
Gauge
ChannelReadyBytes
prometheus
.
Gauge
ChannelOutputBytes
prometheus
.
Gauge
ChannelOutputBytes
prometheus
.
Gauge
ChannelClosedReason
prometheus
.
Gauge
ChannelClosedReason
prometheus
.
Gauge
ChannelNumFrames
prometheus
.
Gauge
ChannelNumFrames
prometheus
.
Gauge
ChannelComprRatio
prometheus
.
Histogram
ChannelComprRatio
prometheus
.
Histogram
ChannelInputBytesTotal
prometheus
.
Counter
ChannelOutputBytesTotal
prometheus
.
Counter
BatcherTxEvs
opmetrics
.
EventVec
BatcherTxEvs
opmetrics
.
EventVec
}
}
...
@@ -144,6 +146,16 @@ func NewMetrics(procName string) *Metrics {
...
@@ -144,6 +146,16 @@ func NewMetrics(procName string) *Metrics {
Help
:
"Compression ratios of closed channel."
,
Help
:
"Compression ratios of closed channel."
,
Buckets
:
append
([]
float64
{
0.1
,
0.2
},
prometheus
.
LinearBuckets
(
0.3
,
0.05
,
14
)
...
),
Buckets
:
append
([]
float64
{
0.1
,
0.2
},
prometheus
.
LinearBuckets
(
0.3
,
0.05
,
14
)
...
),
}),
}),
ChannelInputBytesTotal
:
factory
.
NewCounter
(
prometheus
.
CounterOpts
{
Namespace
:
ns
,
Name
:
"input_bytes_total"
,
Help
:
"Total number of bytes to a channel."
,
}),
ChannelOutputBytesTotal
:
factory
.
NewCounter
(
prometheus
.
CounterOpts
{
Namespace
:
ns
,
Name
:
"output_bytes_total"
,
Help
:
"Total number of compressed output bytes from a channel."
,
}),
BatcherTxEvs
:
opmetrics
.
NewEventVec
(
factory
,
ns
,
""
,
"batcher_tx"
,
"BatcherTx"
,
[]
string
{
"stage"
}),
BatcherTxEvs
:
opmetrics
.
NewEventVec
(
factory
,
ns
,
""
,
"batcher_tx"
,
"BatcherTx"
,
[]
string
{
"stage"
}),
}
}
...
@@ -219,6 +231,8 @@ func (m *Metrics) RecordChannelClosed(id derive.ChannelID, numPendingBlocks int,
...
@@ -219,6 +231,8 @@ func (m *Metrics) RecordChannelClosed(id derive.ChannelID, numPendingBlocks int,
m
.
ChannelNumFrames
.
Set
(
float64
(
numFrames
))
m
.
ChannelNumFrames
.
Set
(
float64
(
numFrames
))
m
.
ChannelInputBytes
.
WithLabelValues
(
StageClosed
)
.
Set
(
float64
(
inputBytes
))
m
.
ChannelInputBytes
.
WithLabelValues
(
StageClosed
)
.
Set
(
float64
(
inputBytes
))
m
.
ChannelOutputBytes
.
Set
(
float64
(
outputComprBytes
))
m
.
ChannelOutputBytes
.
Set
(
float64
(
outputComprBytes
))
m
.
ChannelInputBytesTotal
.
Add
(
float64
(
inputBytes
))
m
.
ChannelOutputBytesTotal
.
Add
(
float64
(
outputComprBytes
))
var
comprRatio
float64
var
comprRatio
float64
if
inputBytes
>
0
{
if
inputBytes
>
0
{
...
...
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