Browse Source
metrics stats of volume layout depends on the data center (#5775)
stats volume layout depends on the data center
pull/5783/head
Konstantin Lebedev
6 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
4 additions and
4 deletions
-
weed/stats/metrics.go
-
weed/topology/volume_layout.go
|
|
@ -76,7 +76,7 @@ var ( |
|
|
|
Subsystem: "master", |
|
|
|
Name: "volume_layout_total", |
|
|
|
Help: "Number of volumes in volume layouts", |
|
|
|
}, []string{"collection", "replica", "type"}) |
|
|
|
}, []string{"collection", "dataCenter", "type"}) |
|
|
|
|
|
|
|
MasterLeaderChangeCounter = prometheus.NewCounterVec( |
|
|
|
prometheus.CounterOpts{ |
|
|
|
|
|
@ -356,9 +356,9 @@ func (vl *VolumeLayout) DoneGrowRequest() { |
|
|
|
|
|
|
|
func (vl *VolumeLayout) ShouldGrowVolumes(option *VolumeGrowOption) bool { |
|
|
|
total, active, crowded := vl.GetActiveVolumeCount(option) |
|
|
|
stats.MasterVolumeLayout.WithLabelValues(option.Collection, option.ReplicaPlacement.String(), "total").Set(float64(total)) |
|
|
|
stats.MasterVolumeLayout.WithLabelValues(option.Collection, option.ReplicaPlacement.String(), "active").Set(float64(active)) |
|
|
|
stats.MasterVolumeLayout.WithLabelValues(option.Collection, option.ReplicaPlacement.String(), "crowded").Set(float64(crowded)) |
|
|
|
stats.MasterVolumeLayout.WithLabelValues(option.Collection, option.DataCenter, "total").Set(float64(total)) |
|
|
|
stats.MasterVolumeLayout.WithLabelValues(option.Collection, option.DataCenter, "active").Set(float64(active)) |
|
|
|
stats.MasterVolumeLayout.WithLabelValues(option.Collection, option.DataCenter, "crowded").Set(float64(crowded)) |
|
|
|
//glog.V(0).Infof("active volume: %d, high usage volume: %d\n", active, high)
|
|
|
|
return active <= crowded |
|
|
|
} |
|
|
|