Refactoring: variable names, adding tests and http constants

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis
2017-12-01 18:19:54 +00:00
parent 2452fdea0b
commit 23a7187435
19 changed files with 166 additions and 80 deletions

View File

@ -15,8 +15,9 @@ import (
// AttachSwarmWatcher adds a go-route to monitor the amount of service replicas in the swarm
// matching a 'function' label.
func AttachSwarmWatcher(dockerClient *client.Client, metricsOptions MetricOptions, label string) {
ticker := time.NewTicker(1 * time.Second)
func AttachSwarmWatcher(dockerClient *client.Client, metricsOptions MetricOptions, label string, interval time.Duration) {
ticker := time.NewTicker(interval)
quit := make(chan struct{})
go func() {
@ -47,5 +48,4 @@ func AttachSwarmWatcher(dockerClient *client.Client, metricsOptions MetricOption
}
}
}()
}