Browse Source

size limit

pull/7525/head
chrislu 2 weeks ago
parent
commit
08774de8ad
  1. 9
      weed/stats/constants_4bytes.go
  2. 9
      weed/stats/constants_5bytes.go
  3. 13
      weed/stats/metrics.go
  4. 2
      weed/util/version/constants.go

9
weed/stats/constants_4bytes.go

@ -1,9 +0,0 @@
//go:build !5BytesOffset
// +build !5BytesOffset
package stats
const (
SizeLimit = "30GB"
)

9
weed/stats/constants_5bytes.go

@ -1,9 +0,0 @@
//go:build 5BytesOffset
// +build 5BytesOffset
package stats
const (
SizeLimit = "8000GB"
)

13
weed/stats/metrics.go

@ -17,20 +17,11 @@ import (
"github.com/seaweedfs/seaweedfs/weed/glog" "github.com/seaweedfs/seaweedfs/weed/glog"
) )
// Version info - these are set by the version package to avoid import cycles
var (
versionNumber = "unknown"
commit = ""
)
// SetVersionInfo sets the version information for the BuildInfo metric // SetVersionInfo sets the version information for the BuildInfo metric
// This is called by the version package during initialization // This is called by the version package during initialization
func SetVersionInfo(version, commitHash string) {
versionNumber = version
commit = commitHash
// Update the metric with the new values
func SetVersionInfo(version, commitHash, sizeLimit string) {
BuildInfo.Reset() BuildInfo.Reset()
BuildInfo.WithLabelValues(versionNumber, commit, SizeLimit, runtime.GOOS, runtime.GOARCH).Set(1)
BuildInfo.WithLabelValues(version, commitHash, sizeLimit, runtime.GOOS, runtime.GOARCH).Set(1)
} }
// Readonly volume types // Readonly volume types

2
weed/util/version/constants.go

@ -17,7 +17,7 @@ var (
func init() { func init() {
// Set version info in stats for Prometheus metrics // Set version info in stats for Prometheus metrics
stats.SetVersionInfo(VERSION_NUMBER, COMMIT)
stats.SetVersionInfo(VERSION_NUMBER, COMMIT, util.SizeLimit)
} }
func Version() string { func Version() string {

Loading…
Cancel
Save