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
768cb10d
Commit
768cb10d
authored
Dec 04, 2023
by
Tei Im
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add derived batch metrics
parent
56f994c9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
0 deletions
+35
-0
metrics.go
op-node/metrics/metrics.go
+22
-0
channel_in_reader.go
op-node/rollup/derive/channel_in_reader.go
+2
-0
pipeline.go
op-node/rollup/derive/pipeline.go
+2
-0
driver.go
op-node/rollup/driver/driver.go
+3
-0
metrics.go
op-service/testutils/metrics.go
+6
-0
No files found.
op-node/metrics/metrics.go
View file @
768cb10d
...
...
@@ -46,6 +46,8 @@ type Metricer interface {
RecordL1Ref
(
name
string
,
ref
eth
.
L1BlockRef
)
RecordL2Ref
(
name
string
,
ref
eth
.
L2BlockRef
)
RecordUnsafePayloadsBuffer
(
length
uint64
,
memSize
uint64
,
next
eth
.
BlockID
)
RecordDerivedSingularBatches
()
RecordDerivedSpanBatches
()
CountSequencedTxs
(
count
int
)
RecordL1ReorgDepth
(
d
uint64
)
RecordSequencerInconsistentL1Origin
(
from
eth
.
BlockID
,
to
eth
.
BlockID
)
...
...
@@ -93,6 +95,9 @@ type Metrics struct {
SequencingErrors
*
metrics
.
Event
PublishingErrors
*
metrics
.
Event
DerivedSingularBatches
*
metrics
.
Event
DerivedSpanBatches
*
metrics
.
Event
P2PReqDurationSeconds
*
prometheus
.
HistogramVec
P2PReqTotal
*
prometheus
.
CounterVec
P2PPayloadByNumber
*
prometheus
.
GaugeVec
...
...
@@ -192,6 +197,9 @@ func NewMetrics(procName string) *Metrics {
SequencingErrors
:
metrics
.
NewEvent
(
factory
,
ns
,
""
,
"sequencing_errors"
,
"sequencing errors"
),
PublishingErrors
:
metrics
.
NewEvent
(
factory
,
ns
,
""
,
"publishing_errors"
,
"p2p publishing errors"
),
DerivedSingularBatches
:
metrics
.
NewEvent
(
factory
,
ns
,
""
,
"derived_singular_batches"
,
"derived singular batches"
),
DerivedSpanBatches
:
metrics
.
NewEvent
(
factory
,
ns
,
""
,
"derived_span_batches"
,
"derived span batches"
),
SequencerInconsistentL1Origin
:
metrics
.
NewEvent
(
factory
,
ns
,
""
,
"sequencer_inconsistent_l1_origin"
,
"events when the sequencer selects an inconsistent L1 origin"
),
SequencerResets
:
metrics
.
NewEvent
(
factory
,
ns
,
""
,
"sequencer_resets"
,
"sequencer resets"
),
...
...
@@ -449,6 +457,14 @@ func (m *Metrics) RecordUnsafePayloadsBuffer(length uint64, memSize uint64, next
m
.
UnsafePayloadsBufferMemSize
.
Set
(
float64
(
memSize
))
}
func
(
m
*
Metrics
)
RecordDerivedSingularBatches
()
{
m
.
DerivedSingularBatches
.
Record
()
}
func
(
m
*
Metrics
)
RecordDerivedSpanBatches
()
{
m
.
DerivedSpanBatches
.
Record
()
}
func
(
m
*
Metrics
)
CountSequencedTxs
(
count
int
)
{
m
.
TransactionsSequencedTotal
.
Add
(
float64
(
count
))
}
...
...
@@ -646,6 +662,12 @@ func (n *noopMetricer) RecordL2Ref(name string, ref eth.L2BlockRef) {
func
(
n
*
noopMetricer
)
RecordUnsafePayloadsBuffer
(
length
uint64
,
memSize
uint64
,
next
eth
.
BlockID
)
{
}
func
(
n
*
noopMetricer
)
RecordDerivedSingularBatches
()
{
}
func
(
n
*
noopMetricer
)
RecordDerivedSpanBatches
()
{
}
func
(
n
*
noopMetricer
)
CountSequencedTxs
(
count
int
)
{
}
...
...
op-node/rollup/derive/channel_in_reader.go
View file @
768cb10d
...
...
@@ -97,6 +97,7 @@ func (cr *ChannelInReader) NextBatch(ctx context.Context) (Batch, error) {
return
nil
,
NewCriticalError
(
errors
.
New
(
"failed type assertion to SingularBatch"
))
}
cr
.
log
.
Debug
(
"decoded singular batch from channel"
)
cr
.
metrics
.
RecordDerivedSingularBatches
()
return
singularBatch
,
nil
case
SpanBatchType
:
if
origin
:=
cr
.
Origin
();
!
cr
.
cfg
.
IsDelta
(
origin
.
Time
)
{
...
...
@@ -115,6 +116,7 @@ func (cr *ChannelInReader) NextBatch(ctx context.Context) (Batch, error) {
return
nil
,
err
}
cr
.
log
.
Debug
(
"decoded span batch from channel"
)
cr
.
metrics
.
RecordDerivedSpanBatches
()
return
spanBatch
,
nil
default
:
// error is bubbled up to user, but pipeline can skip the batch and continue after.
...
...
op-node/rollup/derive/pipeline.go
View file @
768cb10d
...
...
@@ -21,6 +21,8 @@ type Metrics interface {
RecordHeadChannelOpened
()
RecordChannelTimedOut
()
RecordFrame
()
RecordDerivedSingularBatches
()
RecordDerivedSpanBatches
()
}
type
L1Fetcher
interface
{
...
...
op-node/rollup/driver/driver.go
View file @
768cb10d
...
...
@@ -27,6 +27,9 @@ type Metrics interface {
RecordChannelTimedOut
()
RecordFrame
()
RecordDerivedSingularBatches
()
RecordDerivedSpanBatches
()
RecordUnsafePayloadsBuffer
(
length
uint64
,
memSize
uint64
,
next
eth
.
BlockID
)
SetDerivationIdle
(
idle
bool
)
...
...
op-service/testutils/metrics.go
View file @
768cb10d
...
...
@@ -53,6 +53,12 @@ func (t *TestDerivationMetrics) RecordChannelTimedOut() {
func
(
t
*
TestDerivationMetrics
)
RecordFrame
()
{
}
func
(
n
*
TestDerivationMetrics
)
RecordDerivedSingularBatches
()
{
}
func
(
n
*
TestDerivationMetrics
)
RecordDerivedSpanBatches
()
{
}
type
TestRPCMetrics
struct
{}
func
(
n
*
TestRPCMetrics
)
RecordRPCServerRequest
(
method
string
)
func
()
{
...
...
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