mirror of
https://github.com/minio/minio.git
synced 2025-01-25 21:53:16 -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() {
|
func collectLocalResourceMetrics() {
|
||||||
var types madmin.MetricType = madmin.MetricsDisk | madmin.MetricNet | madmin.MetricsMem | madmin.MetricsCPU
|
var types madmin.MetricType = madmin.MetricsDisk | madmin.MetricNet | madmin.MetricsMem | madmin.MetricsCPU
|
||||||
|
|
||||||
m := collectLocalMetrics(types, collectMetricsOpts{
|
m := collectLocalMetrics(types, collectMetricsOpts{})
|
||||||
hosts: map[string]struct{}{
|
for _, hm := range m.ByHost {
|
||||||
globalLocalNodeName: {},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
for host, hm := range m.ByHost {
|
|
||||||
if len(host) > 0 {
|
|
||||||
if hm.Net != nil && len(hm.Net.NetStats.Name) > 0 {
|
if hm.Net != nil && len(hm.Net.NetStats.Name) > 0 {
|
||||||
stats := hm.Net.NetStats
|
stats := hm.Net.NetStats
|
||||||
labels := map[string]string{"interface": stats.Name}
|
labels := map[string]string{"interface": stats.Name}
|
||||||
@ -344,18 +338,12 @@ func collectLocalResourceMetrics() {
|
|||||||
}
|
}
|
||||||
break // only one host expected
|
break // only one host expected
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
collectDriveMetrics(m)
|
collectDriveMetrics(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
func initLatestValues() {
|
func initLatestValues() {
|
||||||
m := collectLocalMetrics(madmin.MetricsDisk, collectMetricsOpts{
|
m := collectLocalMetrics(madmin.MetricsDisk, collectMetricsOpts{})
|
||||||
hosts: map[string]struct{}{
|
|
||||||
globalLocalNodeName: {},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
latestDriveStatsMu.Lock()
|
latestDriveStatsMu.Lock()
|
||||||
latestDriveStats = map[string]madmin.DiskIOStats{}
|
latestDriveStats = map[string]madmin.DiskIOStats{}
|
||||||
for d, dm := range m.ByDisk {
|
for d, dm := range m.ByDisk {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user