mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 11:07:45 +08:00
simplify metrics configuration logic
This commit is contained in:
@@ -157,10 +157,7 @@ func maybeStartMetrics(fs *FilerServer, option *FilerOption) {
|
||||
if metricsAddress == "" && metricsIntervalSec <= 0 {
|
||||
return
|
||||
}
|
||||
go stats.LoopPushingMetric("filer", stats.SourceName(option.Port), stats.FilerGather,
|
||||
func() (addr string, intervalSeconds int) {
|
||||
return metricsAddress, metricsIntervalSec
|
||||
})
|
||||
go stats.LoopPushingMetric("filer", stats.SourceName(option.Port), stats.FilerGather, metricsAddress, metricsIntervalSec)
|
||||
}
|
||||
|
||||
func readFilerConfiguration(grpcDialOption grpc.DialOption, masterAddress string) (metricsAddress string, metricsIntervalSec int, err error) {
|
||||
|
@@ -98,10 +98,7 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string,
|
||||
|
||||
go vs.heartbeat()
|
||||
hostAddress := fmt.Sprintf("%s:%d", ip, port)
|
||||
go stats.LoopPushingMetric("volumeServer", hostAddress, stats.VolumeServerGather,
|
||||
func() (addr string, intervalSeconds int) {
|
||||
return vs.MetricsAddress, vs.MetricsIntervalSec
|
||||
})
|
||||
go stats.LoopPushingMetric("volumeServer", hostAddress, stats.VolumeServerGather, vs.MetricsAddress, vs.MetricsIntervalSec)
|
||||
|
||||
return vs
|
||||
}
|
||||
|
Reference in New Issue
Block a user