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
f46c1e29
Unverified
Commit
f46c1e29
authored
Jan 29, 2024
by
Henri Devieux
Committed by
GitHub
Jan 29, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Emit histogram for blob size (#9233)
* Emit gauge for blob size * use histogram instead of gauge * add buckets
parent
254367c0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
driver.go
op-batcher/batcher/driver.go
+1
-0
metrics.go
op-batcher/metrics/metrics.go
+14
-0
noop.go
op-batcher/metrics/noop.go
+1
-0
No files found.
op-batcher/batcher/driver.go
View file @
f46c1e29
...
...
@@ -372,6 +372,7 @@ func (l *BatchSubmitter) sendTransaction(txdata txData, queue *txmgr.Queue[txDat
// or configuration issue.
return
fmt
.
Errorf
(
"could not create blob tx candidate: %w"
,
err
)
}
l
.
Metr
.
RecordBlobUsedBytes
(
len
(
data
))
}
else
{
candidate
=
l
.
calldataTxCandidate
(
data
)
}
...
...
op-batcher/metrics/metrics.go
View file @
f46c1e29
...
...
@@ -46,6 +46,8 @@ type Metricer interface {
RecordBatchTxSuccess
()
RecordBatchTxFailed
()
RecordBlobUsedBytes
(
num
int
)
Document
()
[]
opmetrics
.
DocumentedMetric
}
...
...
@@ -79,6 +81,8 @@ type Metrics struct {
channelOutputBytesTotal
prometheus
.
Counter
batcherTxEvs
opmetrics
.
EventVec
blobUsedBytes
prometheus
.
Histogram
}
var
_
Metricer
=
(
*
Metrics
)(
nil
)
...
...
@@ -181,6 +185,12 @@ func NewMetrics(procName string) *Metrics {
Name
:
"output_bytes_total"
,
Help
:
"Total number of compressed output bytes from a channel."
,
}),
blobUsedBytes
:
factory
.
NewHistogram
(
prometheus
.
HistogramOpts
{
Namespace
:
ns
,
Name
:
"blob_used_bytes"
,
Help
:
"Blob size in bytes being submitted."
,
Buckets
:
prometheus
.
LinearBuckets
(
0.0
,
eth
.
MaxBlobDataSize
/
13
,
13
),
}),
batcherTxEvs
:
opmetrics
.
NewEventVec
(
factory
,
ns
,
""
,
"batcher_tx"
,
"BatcherTx"
,
[]
string
{
"stage"
}),
}
...
...
@@ -304,6 +314,10 @@ func (m *Metrics) RecordBatchTxFailed() {
m
.
batcherTxEvs
.
Record
(
TxStageFailed
)
}
func
(
m
*
Metrics
)
RecordBlobUsedBytes
(
num
int
)
{
m
.
blobUsedBytes
.
Observe
(
float64
(
num
))
}
// estimateBatchSize estimates the size of the batch
func
estimateBatchSize
(
block
*
types
.
Block
)
uint64
{
size
:=
uint64
(
70
)
// estimated overhead of batch metadata
...
...
op-batcher/metrics/noop.go
View file @
f46c1e29
...
...
@@ -42,6 +42,7 @@ func (*noopMetrics) RecordChannelTimedOut(derive.ChannelID) {}
func
(
*
noopMetrics
)
RecordBatchTxSubmitted
()
{}
func
(
*
noopMetrics
)
RecordBatchTxSuccess
()
{}
func
(
*
noopMetrics
)
RecordBatchTxFailed
()
{}
func
(
*
noopMetrics
)
RecordBlobUsedBytes
(
int
)
{}
func
(
*
noopMetrics
)
StartBalanceMetrics
(
log
.
Logger
,
*
ethclient
.
Client
,
common
.
Address
)
io
.
Closer
{
return
nil
}
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