Skip to content

Commit

Permalink
metrics stats of volume layout depends on the data center (seaweedfs#…
Browse files Browse the repository at this point in the history
…5775)

stats volume layout depends on the data center
  • Loading branch information
kmlebedev authored Jul 12, 2024
1 parent 04f4b10 commit 33964fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion weed/stats/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
6 changes: 3 additions & 3 deletions weed/topology/volume_layout.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 33964fa

Please sign in to comment.