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
d27e841d
Unverified
Commit
d27e841d
authored
Jan 11, 2022
by
Matthew Slipper
Committed by
GitHub
Jan 11, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1997 from cfromknecht/bss-prune-count
feat: add BatchPruneCount metric
parents
a2695a57
8ddbe235
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
driver.go
go/batch-submitter/drivers/sequencer/driver.go
+3
-0
metrics.go
go/batch-submitter/metrics/metrics.go
+11
-0
No files found.
go/batch-submitter/drivers/sequencer/driver.go
View file @
d27e841d
...
@@ -175,6 +175,7 @@ func (d *Driver) SubmitBatchTx(
...
@@ -175,6 +175,7 @@ func (d *Driver) SubmitBatchTx(
}
}
shouldStartAt
:=
start
.
Uint64
()
shouldStartAt
:=
start
.
Uint64
()
var
pruneCount
int
for
{
for
{
batchParams
,
err
:=
GenSequencerBatchParams
(
batchParams
,
err
:=
GenSequencerBatchParams
(
shouldStartAt
,
d
.
cfg
.
BlockOffset
,
batchElements
,
shouldStartAt
,
d
.
cfg
.
BlockOffset
,
batchElements
,
...
@@ -197,6 +198,7 @@ func (d *Driver) SubmitBatchTx(
...
@@ -197,6 +198,7 @@ func (d *Driver) SubmitBatchTx(
newBatchElementsLen
:=
(
oldLen
*
9
)
/
10
newBatchElementsLen
:=
(
oldLen
*
9
)
/
10
batchElements
=
batchElements
[
:
newBatchElementsLen
]
batchElements
=
batchElements
[
:
newBatchElementsLen
]
log
.
Info
(
name
+
" pruned batch"
,
"old_num_txs"
,
oldLen
,
"new_num_txs"
,
newBatchElementsLen
)
log
.
Info
(
name
+
" pruned batch"
,
"old_num_txs"
,
oldLen
,
"new_num_txs"
,
newBatchElementsLen
)
pruneCount
++
continue
continue
}
}
...
@@ -204,6 +206,7 @@ func (d *Driver) SubmitBatchTx(
...
@@ -204,6 +206,7 @@ func (d *Driver) SubmitBatchTx(
batchTxBuildTime
:=
float64
(
time
.
Since
(
batchTxBuildStart
)
/
time
.
Millisecond
)
batchTxBuildTime
:=
float64
(
time
.
Since
(
batchTxBuildStart
)
/
time
.
Millisecond
)
d
.
metrics
.
BatchTxBuildTime
.
Set
(
batchTxBuildTime
)
d
.
metrics
.
BatchTxBuildTime
.
Set
(
batchTxBuildTime
)
d
.
metrics
.
NumElementsPerBatch
.
Observe
(
float64
(
len
(
batchElements
)))
d
.
metrics
.
NumElementsPerBatch
.
Observe
(
float64
(
len
(
batchElements
)))
d
.
metrics
.
BatchPruneCount
.
Set
(
float64
(
pruneCount
))
log
.
Info
(
name
+
" batch constructed"
,
"num_txs"
,
len
(
batchElements
),
"length"
,
len
(
batchCallData
))
log
.
Info
(
name
+
" batch constructed"
,
"num_txs"
,
len
(
batchElements
),
"length"
,
len
(
batchCallData
))
...
...
go/batch-submitter/metrics/metrics.go
View file @
d27e841d
...
@@ -35,6 +35,12 @@ type Metrics struct {
...
@@ -35,6 +35,12 @@ type Metrics struct {
// BatchConfirmationTime tracks the duration it takes to confirm a batch
// BatchConfirmationTime tracks the duration it takes to confirm a batch
// transaction.
// transaction.
BatchConfirmationTime
prometheus
.
Gauge
BatchConfirmationTime
prometheus
.
Gauge
// BatchPruneCount tracks the number of times a batch of sequencer
// transactions is pruned in order to meet the desired size requirements.
//
// NOTE: This is currently only active in the sequencer driver.
BatchPruneCount
prometheus
.
Gauge
}
}
func
NewMetrics
(
subsystem
string
)
*
Metrics
{
func
NewMetrics
(
subsystem
string
)
*
Metrics
{
...
@@ -99,5 +105,10 @@ func NewMetrics(subsystem string) *Metrics {
...
@@ -99,5 +105,10 @@ func NewMetrics(subsystem string) *Metrics {
Help
:
"Time to confirm batch transactions"
,
Help
:
"Time to confirm batch transactions"
,
Subsystem
:
subsystem
,
Subsystem
:
subsystem
,
}),
}),
BatchPruneCount
:
promauto
.
NewGauge
(
prometheus
.
GaugeOpts
{
Name
:
"batch_submitter_batch_prune_count"
,
Help
:
"Number of times a batch is pruned"
,
Subsystem
:
subsystem
,
}),
}
}
}
}
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