summaryrefslogtreecommitdiff
path: root/vendor/go.opencensus.io/metric/metricdata
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/go.opencensus.io/metric/metricdata')
-rw-r--r--vendor/go.opencensus.io/metric/metricdata/doc.go19
-rw-r--r--vendor/go.opencensus.io/metric/metricdata/exemplar.go38
-rw-r--r--vendor/go.opencensus.io/metric/metricdata/label.go35
-rw-r--r--vendor/go.opencensus.io/metric/metricdata/metric.go46
-rw-r--r--vendor/go.opencensus.io/metric/metricdata/point.go193
-rw-r--r--vendor/go.opencensus.io/metric/metricdata/type_string.go16
-rw-r--r--vendor/go.opencensus.io/metric/metricdata/unit.go27
7 files changed, 0 insertions, 374 deletions
diff --git a/vendor/go.opencensus.io/metric/metricdata/doc.go b/vendor/go.opencensus.io/metric/metricdata/doc.go
deleted file mode 100644
index 52a7b3b..0000000
--- a/vendor/go.opencensus.io/metric/metricdata/doc.go
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2018, OpenCensus Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Package metricdata contains the metrics data model.
-//
-// This is an EXPERIMENTAL package, and may change in arbitrary ways without
-// notice.
-package metricdata // import "go.opencensus.io/metric/metricdata"
diff --git a/vendor/go.opencensus.io/metric/metricdata/exemplar.go b/vendor/go.opencensus.io/metric/metricdata/exemplar.go
deleted file mode 100644
index 12695ce..0000000
--- a/vendor/go.opencensus.io/metric/metricdata/exemplar.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2018, OpenCensus Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package metricdata
-
-import (
- "time"
-)
-
-// Exemplars keys.
-const (
- AttachmentKeySpanContext = "SpanContext"
-)
-
-// 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.
-type Exemplar struct {
- Value float64 // the value that was recorded
- Timestamp time.Time // the time the value was recorded
- Attachments Attachments // attachments (if any)
-}
-
-// Attachments is a map of extra values associated with a recorded data point.
-type Attachments map[string]interface{}
diff --git a/vendor/go.opencensus.io/metric/metricdata/label.go b/vendor/go.opencensus.io/metric/metricdata/label.go
deleted file mode 100644
index aadae41..0000000
--- a/vendor/go.opencensus.io/metric/metricdata/label.go
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2018, OpenCensus Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package metricdata
-
-// LabelKey represents key of a label. It has optional
-// description attribute.
-type LabelKey struct {
- Key string
- Description 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.
-type LabelValue struct {
- Value string // string value of the label
- Present bool // flag that indicated whether a value is present or not
-}
-
-// NewLabelValue creates a new non-nil LabelValue that represents the given string.
-func NewLabelValue(val string) LabelValue {
- return LabelValue{Value: val, Present: true}
-}
diff --git a/vendor/go.opencensus.io/metric/metricdata/metric.go b/vendor/go.opencensus.io/metric/metricdata/metric.go
deleted file mode 100644
index 8293712..0000000
--- a/vendor/go.opencensus.io/metric/metricdata/metric.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2018, OpenCensus Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package metricdata
-
-import (
- "time"
-
- "go.opencensus.io/resource"
-)
-
-// Descriptor holds metadata about a metric.
-type Descriptor struct {
- Name string // full name of the metric
- Description string // human-readable description
- Unit Unit // units for the measure
- Type Type // type of measure
- LabelKeys []LabelKey // label keys
-}
-
-// Metric represents a quantity measured against a resource with different
-// label value combinations.
-type Metric struct {
- Descriptor Descriptor // metric descriptor
- Resource *resource.Resource // resource against which this was measured
- TimeSeries []*TimeSeries // one time series for each combination of label values
-}
-
-// TimeSeries is a sequence of points associated with a combination of label
-// values.
-type TimeSeries struct {
- LabelValues []LabelValue // label values, same order as keys in the metric descriptor
- Points []Point // points sequence
- StartTime time.Time // time we started recording this time series
-}
diff --git a/vendor/go.opencensus.io/metric/metricdata/point.go b/vendor/go.opencensus.io/metric/metricdata/point.go
deleted file mode 100644
index 7fe057b..0000000
--- a/vendor/go.opencensus.io/metric/metricdata/point.go
+++ /dev/null
@@ -1,193 +0,0 @@
-// Copyright 2018, OpenCensus Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package metricdata
-
-import (
- "time"
-)
-
-// Point is a single data point of a time series.
-type Point struct {
- // Time is the point in time that this point represents in a time series.
- Time time.Time
- // Value is the value of this point. Prefer using ReadValue to switching on
- // the value type, since new value types might be added.
- Value interface{}
-}
-
-//go:generate stringer -type ValueType
-
-// NewFloat64Point creates a new Point holding a float64 value.
-func NewFloat64Point(t time.Time, val float64) Point {
- return Point{
- Value: val,
- Time: t,
- }
-}
-
-// NewInt64Point creates a new Point holding an int64 value.
-func NewInt64Point(t time.Time, val int64) Point {
- return Point{
- Value: val,
- Time: t,
- }
-}
-
-// NewDistributionPoint creates a new Point holding a Distribution value.
-func NewDistributionPoint(t time.Time, val *Distribution) Point {
- return Point{
- Value: val,
- Time: t,
- }
-}
-
-// NewSummaryPoint creates a new Point holding a Summary value.
-func NewSummaryPoint(t time.Time, val *Summary) Point {
- return Point{
- Value: val,
- Time: t,
- }
-}
-
-// ValueVisitor allows reading the value of a point.
-type ValueVisitor interface {
- VisitFloat64Value(float64)
- VisitInt64Value(int64)
- VisitDistributionValue(*Distribution)
- VisitSummaryValue(*Summary)
-}
-
-// 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 (p Point) ReadValue(vv ValueVisitor) {
- switch v := p.Value.(type) {
- case int64:
- vv.VisitInt64Value(v)
- case float64:
- vv.VisitFloat64Value(v)
- case *Distribution:
- vv.VisitDistributionValue(v)
- case *Summary:
- vv.VisitSummaryValue(v)
- default:
- panic("unexpected value type")
- }
-}
-
-// 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.
-type Distribution struct {
- // 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.
- Count int64
- // Sum is the sum of the values in the population. If count is zero then this field
- // must be zero.
- Sum float64
- // 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.
- SumOfSquaredDeviation float64
- // 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.
- BucketOptions *BucketOptions
- // 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.
- Buckets []Bucket
-}
-
-// BucketOptions describes the bounds of the histogram buckets in this
-// distribution.
-type BucketOptions struct {
- // 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
- Bounds []float64
-}
-
-// Bucket represents a single bucket (value range) in a distribution.
-type Bucket struct {
- // Count is the number of values in each bucket of the histogram, as described in
- // bucket_bounds.
- Count int64
- // Exemplar associated with this bucket (if any).
- Exemplar *Exemplar
-}
-
-// Summary is a representation of percentiles.
-type Summary struct {
- // Count is the cumulative count (if available).
- Count int64
- // Sum is the cumulative sum of values (if available).
- Sum float64
- // HasCountAndSum is true if Count and Sum are available.
- HasCountAndSum bool
- // 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.
- Snapshot Snapshot
-}
-
-// 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.
-type Snapshot struct {
- // Count is the number of values in the snapshot. Optional since some systems don't
- // expose this. Set to 0 if not available.
- Count int64
- // 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.
- Sum float64
- // Percentiles is a map from percentile (range (0-100.0]) to the value of
- // the percentile.
- Percentiles map[float64]float64
-}
-
-//go:generate stringer -type Type
-
-// 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.
-type Type int
-
-// Metric types.
-const (
- TypeGaugeInt64 Type = iota
- TypeGaugeFloat64
- TypeGaugeDistribution
- TypeCumulativeInt64
- TypeCumulativeFloat64
- TypeCumulativeDistribution
- TypeSummary
-)
diff --git a/vendor/go.opencensus.io/metric/metricdata/type_string.go b/vendor/go.opencensus.io/metric/metricdata/type_string.go
deleted file mode 100644
index c3f8ec2..0000000
--- a/vendor/go.opencensus.io/metric/metricdata/type_string.go
+++ /dev/null
@@ -1,16 +0,0 @@
-// Code generated by "stringer -type Type"; DO NOT EDIT.
-
-package metricdata
-
-import "strconv"
-
-const _Type_name = "TypeGaugeInt64TypeGaugeFloat64TypeGaugeDistributionTypeCumulativeInt64TypeCumulativeFloat64TypeCumulativeDistributionTypeSummary"
-
-var _Type_index = [...]uint8{0, 14, 30, 51, 70, 91, 117, 128}
-
-func (i Type) String() string {
- if i < 0 || i >= Type(len(_Type_index)-1) {
- return "Type(" + strconv.FormatInt(int64(i), 10) + ")"
- }
- return _Type_name[_Type_index[i]:_Type_index[i+1]]
-}
diff --git a/vendor/go.opencensus.io/metric/metricdata/unit.go b/vendor/go.opencensus.io/metric/metricdata/unit.go
deleted file mode 100644
index b483a13..0000000
--- a/vendor/go.opencensus.io/metric/metricdata/unit.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2018, OpenCensus Authors
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package metricdata
-
-// Unit is a string encoded according to the case-sensitive abbreviations from the
-// Unified Code for Units of Measure: http://unitsofmeasure.org/ucum.html
-type Unit string
-
-// Predefined units. To record against a unit not represented here, create your
-// own Unit type constant from a string.
-const (
- UnitDimensionless Unit = "1"
- UnitBytes Unit = "By"
- UnitMilliseconds Unit = "ms"
-)