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

@ -71,6 +71,7 @@ func main() {
metrics.RegisterMetrics(metricsOptions)
var faasHandlers handlerSet
servicePollInterval := time.Second * 5
if config.UseExternalProvider() {
@ -86,7 +87,7 @@ func main() {
alertHandler := plugin.NewExternalServiceQuery(*config.FunctionsProviderURL)
faasHandlers.Alert = internalHandlers.MakeAlertHandler(alertHandler)
metrics.AttachExternalWatcher(*config.FunctionsProviderURL, metricsOptions, "func", time.Second*5)
metrics.AttachExternalWatcher(*config.FunctionsProviderURL, metricsOptions, "func", servicePollInterval)
} else {
@ -106,7 +107,7 @@ func main() {
// This could exist in a separate process - records the replicas of each swarm service.
functionLabel := "function"
metrics.AttachSwarmWatcher(dockerClient, metricsOptions, functionLabel)
metrics.AttachSwarmWatcher(dockerClient, metricsOptions, functionLabel, servicePollInterval)
}
if config.UseNATS() {