Initial delivery of metrics code (#81)

* Initial delivery of metrics code

* Fix build issues

* Fix build issue with go vet
This commit is contained in:
Stephen Marshall
2018-05-24 09:15:12 +01:00
committed by Rob Parker
parent e251839639
commit a4b9a9abaf
727 changed files with 108381 additions and 71624 deletions

View File

@@ -23,6 +23,7 @@ import (
"os"
"sync"
"github.com/ibm-messaging/mq-container/internal/metrics"
"github.com/ibm-messaging/mq-container/internal/name"
"github.com/ibm-messaging/mq-container/internal/ready"
)
@@ -117,6 +118,14 @@ func doMain() error {
return err
}
configureQueueManager()
enableMetrics := os.Getenv("MQ_ENABLE_METRICS")
if enableMetrics == "true" || enableMetrics == "1" {
go metrics.GatherMetrics(name, log)
} else {
log.Println("Metrics are disabled")
}
// Start reaping zombies from now on.
// Start this here, so that we don't reap any sub-processes created
// by this process (e.g. for crtmqm or strmqm)