mirror of
https://github.com/minio/minio.git
synced 2025-01-11 23:13:23 -05:00
avoid calling 'admin info' for disk, cpu, net metrics collection (#19762)
resource metrics collection was incorrectly making fan-out liveness peer calls where it's not needed.
This commit is contained in:
parent
08d74819b6
commit
e432e79324
@ -280,14 +280,8 @@ func collectDriveMetrics(m madmin.RealtimeMetrics) {
|
||||
func collectLocalResourceMetrics() {
|
||||
var types madmin.MetricType = madmin.MetricsDisk | madmin.MetricNet | madmin.MetricsMem | madmin.MetricsCPU
|
||||
|
||||
m := collectLocalMetrics(types, collectMetricsOpts{
|
||||
hosts: map[string]struct{}{
|
||||
globalLocalNodeName: {},
|
||||
},
|
||||
})
|
||||
|
||||
for host, hm := range m.ByHost {
|
||||
if len(host) > 0 {
|
||||
m := collectLocalMetrics(types, collectMetricsOpts{})
|
||||
for _, hm := range m.ByHost {
|
||||
if hm.Net != nil && len(hm.Net.NetStats.Name) > 0 {
|
||||
stats := hm.Net.NetStats
|
||||
labels := map[string]string{"interface": stats.Name}
|
||||
@ -344,18 +338,12 @@ func collectLocalResourceMetrics() {
|
||||
}
|
||||
break // only one host expected
|
||||
}
|
||||
}
|
||||
|
||||
collectDriveMetrics(m)
|
||||
}
|
||||
|
||||
func initLatestValues() {
|
||||
m := collectLocalMetrics(madmin.MetricsDisk, collectMetricsOpts{
|
||||
hosts: map[string]struct{}{
|
||||
globalLocalNodeName: {},
|
||||
},
|
||||
})
|
||||
|
||||
m := collectLocalMetrics(madmin.MetricsDisk, collectMetricsOpts{})
|
||||
latestDriveStatsMu.Lock()
|
||||
latestDriveStats = map[string]madmin.DiskIOStats{}
|
||||
for d, dm := range m.ByDisk {
|
||||
|
Loading…
Reference in New Issue
Block a user