|
15 | 15 | package tchannel
|
16 | 16 |
|
17 | 17 | import (
|
18 |
| - "fmt" |
19 | 18 | "testing"
|
20 | 19 | "time"
|
21 | 20 |
|
@@ -105,16 +104,11 @@ func submitTestJaegerBatch(reporter *Reporter) error {
|
105 | 104 | return reporter.EmitBatch(batch)
|
106 | 105 | }
|
107 | 106 |
|
108 |
| -func checkCounters(t *testing.T, mf *metrics.LocalFactory, batchesSubmitted, spansSubmitted, batchesFailures, spansFailures int, prefix string) { |
109 |
| - batchesCounter := fmt.Sprintf("tc-reporter.%s.batches.submitted", prefix) |
110 |
| - batchesFailureCounter := fmt.Sprintf("tc-reporter.%s.batches.failures", prefix) |
111 |
| - spansCounter := fmt.Sprintf("tc-reporter.%s.spans.submitted", prefix) |
112 |
| - spansFailureCounter := fmt.Sprintf("tc-reporter.%s.spans.failures", prefix) |
113 |
| - |
| 107 | +func checkCounters(t *testing.T, mf *metrics.LocalFactory, batchesSubmitted, spansSubmitted, batchesFailures, spansFailures int, format string) { |
114 | 108 | mTestutils.AssertCounterMetrics(t, mf, []mTestutils.ExpectedMetric{
|
115 |
| - {Name: batchesCounter, Value: batchesSubmitted}, |
116 |
| - {Name: spansCounter, Value: spansSubmitted}, |
117 |
| - {Name: batchesFailureCounter, Value: batchesFailures}, |
118 |
| - {Name: spansFailureCounter, Value: spansFailures}, |
| 109 | + {Name: "tchannel-reporter.batches.submitted", Tags: map[string]string{"format": format}, Value: batchesSubmitted}, |
| 110 | + {Name: "tchannel-reporter.spans.submitted", Tags: map[string]string{"format": format}, Value: spansSubmitted}, |
| 111 | + {Name: "tchannel-reporter.batches.failures", Tags: map[string]string{"format": format}, Value: batchesFailures}, |
| 112 | + {Name: "tchannel-reporter.spans.failures", Tags: map[string]string{"format": format}, Value: spansFailures}, |
119 | 113 | }...)
|
120 | 114 | }
|
0 commit comments