GoPLS Viewer

Home|gopls/internal/event/export/metric/info.go
1// Copyright 2019 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
5package metric
6
7import (
8    "golang.org/x/tools/internal/event/keys"
9    "golang.org/x/tools/internal/event/label"
10)
11
12// Scalar represents the construction information for a scalar metric.
13type Scalar struct {
14    // Name is the unique name of this metric.
15    Name string
16    // Description can be used by observers to describe the metric to users.
17    Description string
18    // Keys is the set of labels that collectively describe rows of the metric.
19    Keys []label.Key
20}
21
22// HistogramInt64 represents the construction information for an int64 histogram metric.
23type HistogramInt64 struct {
24    // Name is the unique name of this metric.
25    Name string
26    // Description can be used by observers to describe the metric to users.
27    Description string
28    // Keys is the set of labels that collectively describe rows of the metric.
29    Keys []label.Key
30    // Buckets holds the inclusive upper bound of each bucket in the histogram.
31    Buckets []int64
32}
33
34// HistogramFloat64 represents the construction information for an float64 histogram metric.
35type HistogramFloat64 struct {
36    // Name is the unique name of this metric.
37    Name string
38    // Description can be used by observers to describe the metric to users.
39    Description string
40    // Keys is the set of labels that collectively describe rows of the metric.
41    Keys []label.Key
42    // Buckets holds the inclusive upper bound of each bucket in the histogram.
43    Buckets []float64
44}
45
46// Count creates a new metric based on the Scalar information that counts
47// the number of times the supplied int64 measure is set.
48// Metrics of this type will use Int64Data.
49func (info ScalarCount(e *Configkey label.Key) {
50    data := &Int64Data{Info: &infokeynil}
51    e.subscribe(keydata.count)
52}
53
54// SumInt64 creates a new metric based on the Scalar information that sums all
55// the values recorded on the int64 measure.
56// Metrics of this type will use Int64Data.
57func (info ScalarSumInt64(e *Configkey *keys.Int64) {
58    data := &Int64Data{Info: &infokeykey}
59    e.subscribe(keydata.sum)
60}
61
62// LatestInt64 creates a new metric based on the Scalar information that tracks
63// the most recent value recorded on the int64 measure.
64// Metrics of this type will use Int64Data.
65func (info ScalarLatestInt64(e *Configkey *keys.Int64) {
66    data := &Int64Data{Info: &infoIsGaugetruekeykey}
67    e.subscribe(keydata.latest)
68}
69
70// SumFloat64 creates a new metric based on the Scalar information that sums all
71// the values recorded on the float64 measure.
72// Metrics of this type will use Float64Data.
73func (info ScalarSumFloat64(e *Configkey *keys.Float64) {
74    data := &Float64Data{Info: &infokeykey}
75    e.subscribe(keydata.sum)
76}
77
78// LatestFloat64 creates a new metric based on the Scalar information that tracks
79// the most recent value recorded on the float64 measure.
80// Metrics of this type will use Float64Data.
81func (info ScalarLatestFloat64(e *Configkey *keys.Float64) {
82    data := &Float64Data{Info: &infoIsGaugetruekeykey}
83    e.subscribe(keydata.latest)
84}
85
86// Record creates a new metric based on the HistogramInt64 information that
87// tracks the bucketized counts of values recorded on the int64 measure.
88// Metrics of this type will use HistogramInt64Data.
89func (info HistogramInt64Record(e *Configkey *keys.Int64) {
90    data := &HistogramInt64Data{Info: &infokeykey}
91    e.subscribe(keydata.record)
92}
93
94// Record creates a new metric based on the HistogramFloat64 information that
95// tracks the bucketized counts of values recorded on the float64 measure.
96// Metrics of this type will use HistogramFloat64Data.
97func (info HistogramFloat64Record(e *Configkey *keys.Float64) {
98    data := &HistogramFloat64Data{Info: &infokeykey}
99    e.subscribe(keydata.record)
100}
101
MembersX
Scalar.Count
Scalar.Count.data
HistogramInt64.Record.info
HistogramInt64.Record.key
HistogramFloat64.Keys
Scalar.Keys
HistogramFloat64
Scalar.Count.e
Scalar.LatestInt64.data
Scalar.SumFloat64.data
HistogramInt64.Record.e
HistogramInt64.Record.data
Scalar.Name
HistogramFloat64.Record.info
Scalar.SumInt64.data
Scalar.SumFloat64.info
HistogramFloat64.Record.key
HistogramInt64.Description
HistogramInt64
Scalar.LatestInt64.info
Scalar.SumFloat64.e
Scalar.LatestFloat64
Scalar.LatestFloat64.e
HistogramFloat64.Record
HistogramFloat64.Record.data
Scalar.Description
HistogramInt64.Name
HistogramInt64.Keys
HistogramFloat64.Name
HistogramFloat64.Description
Scalar.SumInt64.key
Scalar.LatestInt64
Scalar.SumFloat64
Scalar
Scalar.LatestFloat64.key
Scalar.SumFloat64.key
Scalar.LatestFloat64.info
HistogramInt64.Record
Scalar.SumInt64.info
Scalar.SumInt64
Scalar.LatestInt64.e
Scalar.LatestInt64.key
Scalar.LatestFloat64.data
Scalar.Count.info
HistogramFloat64.Buckets
Scalar.Count.key
Scalar.SumInt64.e
HistogramFloat64.Record.e
HistogramInt64.Buckets
Members
X