mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
eth/downloader: add metric that tracks the throttle target ratio
This commit is contained in:
parent
8b7f061b12
commit
e5350c9b81
2 changed files with 3 additions and 1 deletions
|
|
@ -38,5 +38,6 @@ var (
|
||||||
receiptDropMeter = metrics.NewRegisteredMeter("eth/downloader/receipts/drop", nil)
|
receiptDropMeter = metrics.NewRegisteredMeter("eth/downloader/receipts/drop", nil)
|
||||||
receiptTimeoutMeter = metrics.NewRegisteredMeter("eth/downloader/receipts/timeout", 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)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -333,6 +333,7 @@ func (q *queue) Results(block bool) []*fetchResult {
|
||||||
(1-common.StorageSize(blockCacheSizeWeight))*q.resultGasSizeRatio
|
(1-common.StorageSize(blockCacheSizeWeight))*q.resultGasSizeRatio
|
||||||
}
|
}
|
||||||
throttleThreshold := q.resultCache.SetThrottleTarget(q.resultGasSizeRatio)
|
throttleThreshold := q.resultCache.SetThrottleTarget(q.resultGasSizeRatio)
|
||||||
|
blockGasSizeRatioGauge.Update(float64(q.resultGasSizeRatio))
|
||||||
|
|
||||||
// With results removed from the cache, wake throttled fetchers
|
// With results removed from the cache, wake throttled fetchers
|
||||||
for _, ch := range []chan bool{q.blockWakeCh, q.receiptWakeCh} {
|
for _, ch := range []chan bool{q.blockWakeCh, q.receiptWakeCh} {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue