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

Side by Side Diff: common/tsmon/types/metric.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 | « common/tsmon/types/cell.go ('k') | common/tsmon/types/metricdataunits.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 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 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 types 5 package types
6 6
7 import ( 7 import (
8 "time" 8 "time"
9 9
10 "github.com/luci/luci-go/common/tsmon/distribution" 10 "github.com/luci/luci-go/common/tsmon/distribution"
11 ) 11 )
12 12
13 // Metric is the low-level interface provided by all metrics. 13 // Metric is the low-level interface provided by all metrics.
14 // Concrete types are defined in the "metrics" package. 14 // Concrete types are defined in the "metrics" package.
15 type Metric interface { 15 type Metric interface {
16 Info() MetricInfo 16 Info() MetricInfo
17 Metadata() MetricMetadata
17 18
18 // SetFixedResetTime overrides the reset time for this metric. Usually cells 19 // SetFixedResetTime overrides the reset time for this metric. Usually cells
19 // take the current time when they're first assigned a value, but it can be 20 // take the current time when they're first assigned a value, but it can be
20 // useful to override the reset time when tracking an external counter. 21 // useful to override the reset time when tracking an external counter.
21 SetFixedResetTime(t time.Time) 22 SetFixedResetTime(t time.Time)
22 } 23 }
23 24
24 // DistributionMetric is the low-level interface provided by all distribution 25 // DistributionMetric is the low-level interface provided by all distribution
25 // metrics. It has a Bucketer which is responsible for assigning buckets to 26 // metrics. It has a Bucketer which is responsible for assigning buckets to
26 // samples. Concrete types are defined in the "metrics" package. 27 // samples. Concrete types are defined in the "metrics" package.
27 type DistributionMetric interface { 28 type DistributionMetric interface {
28 Metric 29 Metric
29 30
30 Bucketer() *distribution.Bucketer 31 Bucketer() *distribution.Bucketer
31 } 32 }
OLDNEW
« no previous file with comments | « common/tsmon/types/cell.go ('k') | common/tsmon/types/metricdataunits.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698