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
16c08152
Unverified
Commit
16c08152
authored
Apr 07, 2023
by
inphi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Counter type for channel_input_bytes
parent
c6a27170
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
metrics.go
op-node/metrics/metrics.go
+3
-3
channel_in_reader.go
op-node/rollup/derive/channel_in_reader.go
+1
-4
No files found.
op-node/metrics/metrics.go
View file @
16c08152
...
...
@@ -132,7 +132,7 @@ type Metrics struct {
GossipEventsTotal
*
prometheus
.
CounterVec
BandwidthTotal
*
prometheus
.
GaugeVec
ChannelInputBytes
prometheus
.
Gauge
ChannelInputBytes
prometheus
.
Counter
registry
*
prometheus
.
Registry
factory
metrics
.
Factory
...
...
@@ -334,7 +334,7 @@ func NewMetrics(procName string) *Metrics {
"direction"
,
}),
ChannelInputBytes
:
factory
.
New
Gauge
(
prometheus
.
Gauge
Opts
{
ChannelInputBytes
:
factory
.
New
Counter
(
prometheus
.
Counter
Opts
{
Namespace
:
ns
,
Name
:
"channel_input_bytes"
,
Help
:
"Number of compressed bytes added to the channel"
,
...
...
@@ -645,7 +645,7 @@ func (m *Metrics) PayloadsQuarantineSize(n int) {
}
func
(
m
*
Metrics
)
RecordChannelInputBytes
(
inputCompressedBytes
int
)
{
m
.
ChannelInputBytes
.
Set
(
float64
(
inputCompressedBytes
))
m
.
ChannelInputBytes
.
Add
(
float64
(
inputCompressedBytes
))
}
type
noopMetricer
struct
{}
...
...
op-node/rollup/derive/channel_in_reader.go
View file @
16c08152
...
...
@@ -23,8 +23,6 @@ type ChannelInReader struct {
prev
*
ChannelBank
metrics
Metrics
// total amount of compressed bytes added to the channel
comprInputBytes
int
}
var
_
ResetableStage
=
(
*
ChannelInReader
)(
nil
)
...
...
@@ -46,8 +44,7 @@ func (cr *ChannelInReader) Origin() eth.L1BlockRef {
func
(
cr
*
ChannelInReader
)
WriteChannel
(
data
[]
byte
)
error
{
if
f
,
err
:=
BatchReader
(
bytes
.
NewBuffer
(
data
),
cr
.
Origin
());
err
==
nil
{
cr
.
nextBatchFn
=
f
cr
.
comprInputBytes
+=
len
(
data
)
cr
.
metrics
.
RecordChannelInputBytes
(
cr
.
comprInputBytes
)
cr
.
metrics
.
RecordChannelInputBytes
(
len
(
data
))
return
nil
}
else
{
cr
.
log
.
Error
(
"Error creating batch reader from channel data"
,
"err"
,
err
)
...
...
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