diff --git a/eth/downloader/metrics.go b/eth/downloader/metrics.go index 608b39828b..4965f4d0c8 100644 --- a/eth/downloader/metrics.go +++ b/eth/downloader/metrics.go @@ -38,5 +38,6 @@ var ( receiptDropMeter = metrics.NewRegisteredMeter("eth/downloader/receipts/drop", nil) receiptTimeoutMeter = metrics.NewRegisteredMeter("eth/downloader/receipts/timeout", nil) - throttleCounter = metrics.NewRegisteredCounter("eth/downloader/throttle", nil) + throttleCounter = metrics.NewRegisteredCounter("eth/downloader/throttle", nil) + blockGasSizeRatioGauge = metrics.NewRegisteredGaugeFloat64("eth/downloader/gassizeratio", nil) ) diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index 8a117f1f7d..9b93c1c7f7 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -333,6 +333,7 @@ func (q *queue) Results(block bool) []*fetchResult { (1-common.StorageSize(blockCacheSizeWeight))*q.resultGasSizeRatio } throttleThreshold := q.resultCache.SetThrottleTarget(q.resultGasSizeRatio) + blockGasSizeRatioGauge.Update(float64(q.resultGasSizeRatio)) // With results removed from the cache, wake throttled fetchers for _, ch := range []chan bool{q.blockWakeCh, q.receiptWakeCh} {