diff --git a/client/test_metrics_exporter/main.go b/client/test_metrics_exporter/main.go index 321b7b5..f40ee78 100644 --- a/client/test_metrics_exporter/main.go +++ b/client/test_metrics_exporter/main.go @@ -48,7 +48,11 @@ func main() { for testId, count := range NUM_TEST_RETRIES { GLOBAL_STATSD.Distribution("test_retry_count", float64(count), []string{"test:" + testId, "os:" + runtime.GOOS}, 1.0) } - fmt.Printf("Uploaded data about %d tests to datadog\n", len(NUM_TEST_RETRIES)) + if GLOBAL_STATSD == nil { + fmt.Printf("Skipped uploading data about %d tests to datadog because GLOBAL_STATSD==nil\n", len(NUM_TEST_RETRIES)) + } else { + fmt.Printf("Uploaded data about %d tests to datadog\n", len(NUM_TEST_RETRIES)) + } } type eventHandler struct{}