Improvements to metrics code

This commit is contained in:
Stephen Marshall
2018-06-12 16:56:44 +01:00
parent 16abf50f9a
commit 53fdfe55de
6 changed files with 169 additions and 137 deletions

View File

@@ -69,14 +69,13 @@ func TestMetricNames(t *testing.T) {
time.Sleep(15 * time.Second)
// Now actually get the metrics (after waiting for some to become available)
// NB: There are currently a total of 93 metrics, but 3 do not generate values (based on the queue manager configuration)
metrics := getMetrics(t, port)
if len(metrics) != 90 {
t.Errorf("Expected 90 metrics to be returned, received %d", len(metrics))
names := metricNames()
if len(metrics) != len(names) {
t.Errorf("Expected %d metrics to be returned, received %d", len(names), len(metrics))
}
// Check all the metrics have the correct names
names := metricNames()
for _, metric := range metrics {
ok := false
for _, name := range names {