| 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/field" | 10 "github.com/luci/luci-go/common/tsmon/field" |
| 11 ) | 11 ) |
| 12 | 12 |
| 13 // Cell is the smallest unit of data recorded by tsmon. Metrics can be | 13 // Cell is the smallest unit of data recorded by tsmon. Metrics can be |
| 14 // thought of as multi-dimensional maps (with fields defining the dimensions) - | 14 // thought of as multi-dimensional maps (with fields defining the dimensions) - |
| 15 // a Cell is one value in that map, with information about its fields and its | 15 // a Cell is one value in that map, with information about its fields and its |
| 16 // type. | 16 // type. |
| 17 type Cell struct { | 17 type Cell struct { |
| 18 MetricInfo | 18 MetricInfo |
| 19 MetricMetadata |
| 19 CellData | 20 CellData |
| 20 } | 21 } |
| 21 | 22 |
| 22 // MetricInfo contains the definition of a metric. | 23 // MetricInfo contains the definition of a metric. |
| 23 type MetricInfo struct { | 24 type MetricInfo struct { |
| 24 Name string | 25 Name string |
| 25 Description string | 26 Description string |
| 26 Fields []field.Field | 27 Fields []field.Field |
| 27 ValueType ValueType | 28 ValueType ValueType |
| 28 } | 29 } |
| 29 | 30 |
| 31 // MetricMetadata contains user-provided metadata for a metric. |
| 32 type MetricMetadata struct { |
| 33 Units MetricDataUnits // the unit of recorded data for a given metric. |
| 34 } |
| 35 |
| 30 // CellData contains the value of a single cell. | 36 // CellData contains the value of a single cell. |
| 31 type CellData struct { | 37 type CellData struct { |
| 32 FieldVals []interface{} | 38 FieldVals []interface{} |
| 33 Target Target | 39 Target Target |
| 34 ResetTime time.Time | 40 ResetTime time.Time |
| 35 Value interface{} | 41 Value interface{} |
| 36 } | 42 } |
| OLD | NEW |