volume servers get metrics address and interval from the master

This commit is contained in:
Chris Lu
2019-06-17 14:51:47 -07:00
parent 68d1bef236
commit d8ed73926d
11 changed files with 192 additions and 157 deletions

View File

@@ -34,6 +34,8 @@ type MasterServer struct {
defaultReplicaPlacement string
garbageThreshold float64
guard *security.Guard
metricsAddress string
metricsIntervalSec int
Topo *topology.Topology
vg *topology.VolumeGrowth
@@ -56,6 +58,8 @@ func NewMasterServer(r *mux.Router, port int, metaFolder string,
garbageThreshold float64,
whiteList []string,
disableHttp bool,
metricsAddress string,
metricsIntervalSec int,
) *MasterServer {
v := viper.GetViper()
@@ -80,6 +84,8 @@ func NewMasterServer(r *mux.Router, port int, metaFolder string,
garbageThreshold: garbageThreshold,
clientChans: make(map[string]chan *master_pb.VolumeLocation),
grpcDialOpiton: security.LoadClientTLS(v.Sub("grpc"), "master"),
metricsAddress: metricsAddress,
metricsIntervalSec: metricsIntervalSec,
}
ms.bounedLeaderChan = make(chan int, 16)
seq := sequence.NewMemorySequencer()