mirror of
https://github.com/minio/minio.git
synced 2025-11-25 03:56:17 -05:00
fix: peer replication bandwidth monitoring in distributed setup (#10652)
This commit is contained in:
@@ -91,18 +91,16 @@ func NewMonitor(doneCh <-chan struct{}) *Monitor {
|
||||
// SelectionFunction for buckets
|
||||
type SelectionFunction func(bucket string) bool
|
||||
|
||||
// SelectAllBuckets will select all buckets
|
||||
func SelectAllBuckets() SelectionFunction {
|
||||
return func(bucket string) bool {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
// SelectBuckets will select all the buckets passed in.
|
||||
func SelectBuckets(buckets ...string) SelectionFunction {
|
||||
if len(buckets) == 0 {
|
||||
return func(bucket string) bool {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return func(bucket string) bool {
|
||||
for _, b := range buckets {
|
||||
if b != "" && b == bucket {
|
||||
if b == "" || b == bucket {
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -160,7 +158,7 @@ func (m *Monitor) processAvg() {
|
||||
for _, bucketMeasurement := range m.activeBuckets {
|
||||
bucketMeasurement.updateExponentialMovingAverage(time.Now())
|
||||
}
|
||||
m.pubsub.Publish(m.getReport(SelectAllBuckets()))
|
||||
m.pubsub.Publish(m.getReport(SelectBuckets()))
|
||||
}
|
||||
|
||||
// track returns the measurement object for bucket and object
|
||||
|
||||
Reference in New Issue
Block a user