Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: common/tsmon/callback_test.go

Issue 2123853002: Added unit annotation supports onto tsmon in go. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: Specify the unit of logdog/collector/subscription/processing_time_ms with types.Milliseconds Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « client/cmd/luci_machine_tokend/status.go ('k') | common/tsmon/flush_test.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « client/cmd/luci_machine_tokend/status.go ('k') | common/tsmon/flush_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698