mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
Updated Prometheus metrics (#11141)
* Add metrics for nodes online and offline * Add cluster capacity metrics * Introduce v2 metrics
This commit is contained in:
@@ -158,8 +158,8 @@ type PerfInfo struct {
|
||||
// ServerDrivesInfo - Drive info about all drives in a single MinIO node
|
||||
type ServerDrivesInfo struct {
|
||||
Addr string `json:"addr"`
|
||||
Serial []DrivePerfInfo `json:"serial,omitempty"`
|
||||
Parallel []DrivePerfInfo `json:"parallel,omitempty"`
|
||||
Serial []DrivePerfInfo `json:"serial,omitempty"` // Drive perf info collected one drive at a time
|
||||
Parallel []DrivePerfInfo `json:"parallel,omitempty"` // Drive perf info collected in parallel
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
@@ -316,3 +316,27 @@ func (adm *AdminClient) ServerHealthInfo(ctx context.Context, healthDataTypes []
|
||||
return respChan
|
||||
|
||||
}
|
||||
|
||||
// GetTotalCapacity gets the total capacity a server holds.
|
||||
func (s *ServerDiskHwInfo) GetTotalCapacity() (capacity uint64) {
|
||||
for _, u := range s.Usage {
|
||||
capacity += u.Total
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// GetTotalFreeCapacity gets the total capacity that is free.
|
||||
func (s *ServerDiskHwInfo) GetTotalFreeCapacity() (capacity uint64) {
|
||||
for _, u := range s.Usage {
|
||||
capacity += u.Free
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// GetTotalUsedCapacity gets the total capacity used.
|
||||
func (s *ServerDiskHwInfo) GetTotalUsedCapacity() (capacity uint64) {
|
||||
for _, u := range s.Usage {
|
||||
capacity += u.Used
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user