(t *testing.T)
| 215 | } |
| 216 | |
| 217 | func TestTimer(t *testing.T) { |
| 218 | m := NewMetric("test", "prog", Timer, Int) |
| 219 | n := NewMetric("test", "prog", Timer, Int) |
| 220 | testutil.ExpectNoDiff(t, m, n, testutil.IgnoreUnexported(sync.RWMutex{}, Metric{})) |
| 221 | d, _ := m.GetDatum() |
| 222 | datum.IncIntBy(d, 1, time.Now().UTC()) |
| 223 | lv := m.FindLabelValueOrNil([]string{}) |
| 224 | if lv == nil { |
| 225 | t.Fatal("couldn't find labelvalue") |
| 226 | } |
| 227 | newD := lv.Value |
| 228 | if newD == nil { |
| 229 | t.Errorf("new_d is nil") |
| 230 | } |
| 231 | if newD.ValueString() != "1" { |
| 232 | t.Errorf("value not 1") |
| 233 | } |
| 234 | } |
| 235 | |
| 236 | func TestRemoveMetricLabelValue(t *testing.T) { |
| 237 | m := NewMetric("test", "prog", Counter, Int, "a", "b", "c") |
nothing calls this directly
no test coverage detected