diff options
| author | hilimd <68371223+hilimd@users.noreply.github.com> | 2020-09-25 09:45:56 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-25 09:45:56 +0800 |
| commit | 76e24a5660a2192603b7d6d84aef1924ab95cb94 (patch) | |
| tree | 72e1b320c3487aa5f6cb3cd5fc849bfd94108ec8 /weed/command/volume.go | |
| parent | 48c578410fea2128f81356250b2cd9d56074d878 (diff) | |
| parent | 043b0631369bec00b33eb53cdf2cdef3eced006c (diff) | |
| download | seaweedfs-76e24a5660a2192603b7d6d84aef1924ab95cb94.tar.xz seaweedfs-76e24a5660a2192603b7d6d84aef1924ab95cb94.zip | |
Merge pull request #20 from chrislusf/master
sync
Diffstat (limited to 'weed/command/volume.go')
| -rw-r--r-- | weed/command/volume.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/weed/command/volume.go b/weed/command/volume.go index 92f83f945..dfc649ba5 100644 --- a/weed/command/volume.go +++ b/weed/command/volume.go @@ -25,6 +25,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/pb/volume_server_pb" "github.com/chrislusf/seaweedfs/weed/server" + stats_collect "github.com/chrislusf/seaweedfs/weed/stats" "github.com/chrislusf/seaweedfs/weed/storage" "github.com/chrislusf/seaweedfs/weed/util" ) @@ -56,6 +57,7 @@ type VolumeServerOptions struct { minFreeSpacePercents []float32 pprof *bool preStopSeconds *int + metricsHttpPort *int // pulseSeconds *int } @@ -80,6 +82,7 @@ func init() { v.compactionMBPerSecond = cmdVolume.Flag.Int("compactionMBps", 0, "limit background compaction or copying speed in mega bytes per second") v.fileSizeLimitMB = cmdVolume.Flag.Int("fileSizeLimitMB", 1024, "limit file size to avoid out of memory") v.pprof = cmdVolume.Flag.Bool("pprof", false, "enable pprof http handlers. precludes --memprofile and --cpuprofile") + v.metricsHttpPort = cmdVolume.Flag.Int("metricsPort", 0, "Prometheus metrics listen port") } var cmdVolume = &Command{ @@ -109,6 +112,8 @@ func runVolume(cmd *Command, args []string) bool { grace.SetupProfiling(*v.cpuProfile, *v.memProfile) } + go stats_collect.StartMetricsServer(*v.metricsHttpPort) + v.startVolumeServer(*volumeFolders, *maxVolumeCounts, *volumeWhiteListOption, *minFreeSpacePercent) return true |
