OLD | NEW |
1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
4 | 4 |
5 package tsmon | 5 package tsmon |
6 | 6 |
7 import ( | 7 import ( |
8 "testing" | 8 "testing" |
9 "time" | 9 "time" |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 Convey("Callback is run on Flush", t, func() { | 28 Convey("Callback is run on Flush", t, func() { |
29 c, s, m := WithFakes(c) | 29 c, s, m := WithFakes(c) |
30 | 30 |
31 RegisterCallbackIn(c, func(c context.Context) { | 31 RegisterCallbackIn(c, func(c context.Context) { |
32 s.Cells = append(s.Cells, types.Cell{ | 32 s.Cells = append(s.Cells, types.Cell{ |
33 types.MetricInfo{ | 33 types.MetricInfo{ |
34 Name: "foo", | 34 Name: "foo", |
35 Fields: []field.Field{}, | 35 Fields: []field.Field{}, |
36 ValueType: types.StringType, | 36 ValueType: types.StringType, |
37 }, | 37 }, |
| 38 types.MetricMetadata{}, |
38 types.CellData{ | 39 types.CellData{ |
39 FieldVals: []interface{}{}, | 40 FieldVals: []interface{}{}, |
40 ResetTime: time.Unix(1234, 1000), | 41 ResetTime: time.Unix(1234, 1000), |
41 Value: "bar", | 42 Value: "bar", |
42 }, | 43 }, |
43 }) | 44 }) |
44 }) | 45 }) |
45 | 46 |
46 So(Flush(c), ShouldBeNil) | 47 So(Flush(c), ShouldBeNil) |
47 | 48 |
48 So(len(m.Cells), ShouldEqual, 1) | 49 So(len(m.Cells), ShouldEqual, 1) |
49 So(len(m.Cells[0]), ShouldEqual, 1) | 50 So(len(m.Cells[0]), ShouldEqual, 1) |
50 So(m.Cells[0][0], ShouldResemble, types.Cell{ | 51 So(m.Cells[0][0], ShouldResemble, types.Cell{ |
51 types.MetricInfo{ | 52 types.MetricInfo{ |
52 Name: "foo", | 53 Name: "foo", |
53 Fields: []field.Field{}, | 54 Fields: []field.Field{}, |
54 ValueType: types.StringType, | 55 ValueType: types.StringType, |
55 }, | 56 }, |
| 57 types.MetricMetadata{}, |
56 types.CellData{ | 58 types.CellData{ |
57 FieldVals: []interface{}{}, | 59 FieldVals: []interface{}{}, |
58 ResetTime: time.Unix(1234, 1000), | 60 ResetTime: time.Unix(1234, 1000), |
59 Value: "bar", | 61 Value: "bar", |
60 }, | 62 }, |
61 }) | 63 }) |
62 }) | 64 }) |
63 } | 65 } |
OLD | NEW |