package metricdata

Import Path
	go.opencensus.io/metric/metricdata (on go.dev)

Dependency Relation
	imports 3 packages, and imported by 7 packages

Involved Source Files Package metricdata contains the metrics data model. This is an EXPERIMENTAL package, and may change in arbitrary ways without notice. exemplar.go label.go metric.go point.go type_string.go unit.go
Package-Level Type Names (total 16, all are exported)
/* sort exporteds by: | */
Attachments is a map of extra values associated with a recorded data point. func go.opencensus.io/stats.WithAttachments(attachments Attachments) stats.Options
Bucket represents a single bucket (value range) in a distribution. Count is the number of values in each bucket of the histogram, as described in bucket_bounds. Exemplar associated with this bucket (if any).
BucketOptions describes the bounds of the histogram buckets in this distribution. Bounds specifies a set of bucket upper bounds. This defines len(bounds) + 1 (= N) buckets. The boundaries for bucket index i are: [0, Bounds[i]) for i == 0 [Bounds[i-1], Bounds[i]) for 0 < i < N-1 [Bounds[i-1], +infinity) for i == N-1
Descriptor holds metadata about a metric. // human-readable description // label keys // full name of the metric // type of measure // units for the measure
Distribution contains summary statistics for a population of values. It optionally contains a histogram representing the distribution of those values across a set of buckets. BucketOptions describes the bounds of the histogram buckets in this distribution. A Distribution may optionally contain a histogram of the values in the population. If nil, there is no associated histogram. Bucket If the distribution does not have a histogram, then omit this field. If there is a histogram, then the sum of the values in the Bucket counts must equal the value in the count field of the distribution. Count is the number of values in the population. Must be non-negative. This value must equal the sum of the values in bucket_counts if a histogram is provided. Sum is the sum of the values in the population. If count is zero then this field must be zero. SumOfSquaredDeviation is the sum of squared deviations from the mean of the values in the population. For values x_i this is: Sum[i=1..n]((x_i - mean)^2) Knuth, "The Art of Computer Programming", Vol. 2, page 323, 3rd edition describes Welford's method for accumulating this sum in one pass. If count is zero then this field must be zero. func NewDistributionPoint(t time.Time, val *Distribution) Point func ValueVisitor.VisitDistributionValue(*Distribution)
Exemplar is an example data point associated with each bucket of a distribution type aggregation. Their purpose is to provide an example of the kind of thing (request, RPC, trace span, etc.) that resulted in that measurement. // attachments (if any) // the time the value was recorded // the value that was recorded
LabelKey represents key of a label. It has optional description attribute. Description string Key string
LabelValue represents the value of a label. The zero value represents a missing label value, which may be treated differently to an empty string value by some back ends. // flag that indicated whether a value is present or not // string value of the label func NewLabelValue(val string) LabelValue
Metric represents a quantity measured against a resource with different label value combinations. // metric descriptor // resource against which this was measured // one time series for each combination of label values func go.opencensus.io/metric/metricproducer.Producer.Read() []*Metric func go.opencensus.io/metric/metricexport.Exporter.ExportMetrics(ctx context.Context, data []*Metric) error func contrib.go.opencensus.io/exporter/stackdriver.(*Exporter).ExportMetrics(ctx context.Context, metrics []*Metric) error
Point is a single data point of a time series. Time is the point in time that this point represents in a time series. Value is the value of this point. Prefer using ReadValue to switching on the value type, since new value types might be added. ReadValue accepts a ValueVisitor and calls the appropriate method with the value of this point. Consumers of Point should use this in preference to switching on the type of the value directly, since new value types may be added. func NewDistributionPoint(t time.Time, val *Distribution) Point func NewFloat64Point(t time.Time, val float64) Point func NewInt64Point(t time.Time, val int64) Point func NewSummaryPoint(t time.Time, val *Summary) Point
Snapshot represents percentiles over an arbitrary time. The values in this struct can be reset at arbitrary unknown times, with the requirement that all of them are reset at the same time. Count is the number of values in the snapshot. Optional since some systems don't expose this. Set to 0 if not available. Percentiles is a map from percentile (range (0-100.0]) to the value of the percentile. Sum is the sum of values in the snapshot. Optional since some systems don't expose this. If count is 0 then this field must be zero.
Summary is a representation of percentiles. Count is the cumulative count (if available). HasCountAndSum is true if Count and Sum are available. Snapshot represents percentiles calculated over an arbitrary time window. The values in this struct can be reset at arbitrary unknown times, with the requirement that all of them are reset at the same time. Sum is the cumulative sum of values (if available). func NewSummaryPoint(t time.Time, val *Summary) Point func ValueVisitor.VisitSummaryValue(*Summary)
TimeSeries is a sequence of points associated with a combination of label values. // label values, same order as keys in the metric descriptor // points sequence // time we started recording this time series
Type is the overall type of metric, including its value type and whether it represents a cumulative total (since the start time) or if it represents a gauge value. ( T) String() string T : expvar.Var T : fmt.Stringer const TypeCumulativeDistribution const TypeCumulativeFloat64 const TypeCumulativeInt64 const TypeGaugeDistribution const TypeGaugeFloat64 const TypeGaugeInt64 const TypeSummary
Unit is a string encoded according to the case-sensitive abbreviations from the Unified Code for Units of Measure: http://unitsofmeasure.org/ucum.html const UnitBytes const UnitDimensionless const UnitMilliseconds
ValueVisitor allows reading the value of a point. ( T) VisitDistributionValue(*Distribution) ( T) VisitFloat64Value(float64) ( T) VisitInt64Value(int64) ( T) VisitSummaryValue(*Summary) func Point.ReadValue(vv ValueVisitor)
Package-Level Functions (total 5, all are exported)
NewDistributionPoint creates a new Point holding a Distribution value.
NewFloat64Point creates a new Point holding a float64 value.
NewInt64Point creates a new Point holding an int64 value.
NewLabelValue creates a new non-nil LabelValue that represents the given string.
NewSummaryPoint creates a new Point holding a Summary value.
Package-Level Variables (only one, which is unexported)
Package-Level Constants (total 12, in which 11 are exported)
Exemplars keys.
Metric types.
Metric types.
Metric types.
Metric types.
Metric types.
Metric types.
Predefined units. To record against a unit not represented here, create your own Unit type constant from a string.
Predefined units. To record against a unit not represented here, create your own Unit type constant from a string.
Predefined units. To record against a unit not represented here, create your own Unit type constant from a string.