|
@ -45,6 +45,8 @@ type VolumeServerOptions struct { |
|
|
cpuProfile *string |
|
|
cpuProfile *string |
|
|
memProfile *string |
|
|
memProfile *string |
|
|
compactionMBPerSecond *int |
|
|
compactionMBPerSecond *int |
|
|
|
|
|
metricsAddress *string |
|
|
|
|
|
metricsIntervalSec *int |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func init() { |
|
|
func init() { |
|
@ -66,6 +68,8 @@ func init() { |
|
|
v.cpuProfile = cmdVolume.Flag.String("cpuprofile", "", "cpu profile output file") |
|
|
v.cpuProfile = cmdVolume.Flag.String("cpuprofile", "", "cpu profile output file") |
|
|
v.memProfile = cmdVolume.Flag.String("memprofile", "", "memory profile output file") |
|
|
v.memProfile = cmdVolume.Flag.String("memprofile", "", "memory profile output file") |
|
|
v.compactionMBPerSecond = cmdVolume.Flag.Int("compactionMBps", 0, "limit background compaction or copying speed in mega bytes per second") |
|
|
v.compactionMBPerSecond = cmdVolume.Flag.Int("compactionMBps", 0, "limit background compaction or copying speed in mega bytes per second") |
|
|
|
|
|
v.metricsAddress = cmdVolume.Flag.String("metrics.address", "", "Prometheus gateway address") |
|
|
|
|
|
v.metricsIntervalSec = cmdVolume.Flag.Int("metrics.intervalSeconds", 15, "Prometheus push interval in seconds") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var cmdVolume = &Command{ |
|
|
var cmdVolume = &Command{ |
|
@ -161,6 +165,8 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v |
|
|
v.whiteList, |
|
|
v.whiteList, |
|
|
*v.fixJpgOrientation, *v.readRedirect, |
|
|
*v.fixJpgOrientation, *v.readRedirect, |
|
|
*v.compactionMBPerSecond, |
|
|
*v.compactionMBPerSecond, |
|
|
|
|
|
*v.metricsAddress, |
|
|
|
|
|
*v.metricsIntervalSec, |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
listeningAddress := *v.bindIp + ":" + strconv.Itoa(*v.port) |
|
|
listeningAddress := *v.bindIp + ":" + strconv.Itoa(*v.port) |
|
|