fix possible crash in bucket bandwidth monitor (#11986)

This commit is contained in:
Harshavardhana 2021-04-06 11:01:53 -07:00 committed by GitHub
parent 02f797a23b
commit 4248b1bf6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -123,8 +123,12 @@ func (m *Monitor) getReport(selectBucket SelectionFunction) *bandwidth.Report {
if !selectBucket(bucket) {
continue
}
bucketThrottle, ok := m.bucketThrottle[bucket]
if !ok {
continue
}
report.BucketStats[bucket] = bandwidth.Details{
LimitInBytesPerSecond: m.bucketThrottle[bucket].clusterBandwidth,
LimitInBytesPerSecond: bucketThrottle.clusterBandwidth,
CurrentBandwidthInBytesPerSecond: bucketMeasurement.getExpMovingAvgBytesPerSecond(),
}
}