]> Cypherpunks.ru repositories - gostls13.git/blob - src/runtime/metrics/sample.go
runtime/metrics: add package interface
[gostls13.git] / src / runtime / metrics / sample.go
1 // Copyright 2020 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package metrics
6
7 // Sample captures a single metric sample.
8 type Sample struct {
9         // Name is the name of the metric sampled.
10         //
11         // It must correspond to a name in one of the metric descriptions
12         // returned by Descriptions.
13         Name string
14
15         // Value is the value of the metric sample.
16         Value Value
17 }
18
19 // Read populates each Value field in the given slice of metric samples.
20 //
21 // Desired metrics should be present in the slice with the appropriate name.
22 // The user of this API is encouraged to re-use the same slice between calls.
23 //
24 // Metric values with names not appearing in the value returned by Descriptions
25 // will have the value populated as KindBad to indicate that the name is
26 // unknown.
27 func Read(m []Sample) {
28         panic("unimplemented")
29 }