Skip to content

Commit 6b36a3e

Browse files
authored
experimental/stats: re-add type aliases for migration (#7929) (#7941)
1 parent 4535c6d commit 6b36a3e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

experimental/stats/metrics.go

+15
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
// Package stats contains experimental metrics/stats API's.
2020
package stats
2121

22+
import "google.golang.org/grpc/stats"
23+
2224
// MetricsRecorder records on metrics derived from metric registry.
2325
type MetricsRecorder interface {
2426
// RecordInt64Count records the measurement alongside labels on the int
@@ -37,3 +39,16 @@ type MetricsRecorder interface {
3739
// gauge associated with the provided handle.
3840
RecordInt64Gauge(handle *Int64GaugeHandle, incr int64, labels ...string)
3941
}
42+
43+
// Metrics is an experimental legacy alias of the now-stable stats.MetricSet.
44+
// Metrics will be deleted in a future release.
45+
type Metrics = stats.MetricSet
46+
47+
// Metric was replaced by direct usage of strings.
48+
type Metric = string
49+
50+
// NewMetrics is an experimental legacy alias of the now-stable
51+
// stats.NewMetricSet. NewMetrics will be deleted in a future release.
52+
func NewMetrics(metrics ...Metric) *Metrics {
53+
return stats.NewMetricSet(metrics...)
54+
}

0 commit comments

Comments
 (0)