| OLD | NEW |
| 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 } |
| OLD | NEW |