Commit 69118ac3 authored by Conner Fromknecht's avatar Conner Fromknecht

feat: make num_elements_per_batch metric a Summary

The histogram doesn't seem to render too well on Grafana, but the
batch_size_bytes one does. This commit modifies the
num_elements_per_batch to also use a Summary with the same buckets.
parent fe321618
---
'@eth-optimism/batch-submitter-service': patch
---
Switch num_elements_per_batch from Histogram to Summary
......@@ -12,11 +12,11 @@ type Metrics struct {
ETHBalance prometheus.Gauge
// BatchSizeInBytes tracks the size of batch submission transactions.
BatchSizeInBytes prometheus.Histogram
BatchSizeInBytes prometheus.Summary
// NumElementsPerBatch tracks the number of L2 transactions in each batch
// submission.
NumElementsPerBatch prometheus.Histogram
NumElementsPerBatch prometheus.Summary
// SubmissionTimestamp tracks the time at which each batch was confirmed.
SubmissionTimestamp prometheus.Gauge
......@@ -59,23 +59,10 @@ func NewMetrics(subsystem string) *Metrics {
Subsystem: subsystem,
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
}),
NumElementsPerBatch: promauto.NewHistogram(prometheus.HistogramOpts{
NumElementsPerBatch: promauto.NewSummary(prometheus.SummaryOpts{
Name: "num_elements_per_batch",
Help: "Number of transaction in each batch",
Buckets: []float64{
250,
500,
750,
1000,
1250,
1500,
1750,
2000,
2250,
2500,
2750,
3000,
},
Help: "Number of elements in each batch",
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
Subsystem: subsystem,
}),
SubmissionTimestamp: promauto.NewGauge(prometheus.GaugeOpts{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment