experimental/stats: re-add type aliases for migration (#7929)

This commit is contained in:
Doug Fawley 2024-12-13 11:24:39 -08:00 committed by GitHub
parent 38a8b9a705
commit 7ee073d325
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 0 deletions

View File

@ -19,6 +19,8 @@
// Package stats contains experimental metrics/stats API's.
package stats
import "google.golang.org/grpc/stats"
// MetricsRecorder records on metrics derived from metric registry.
type MetricsRecorder interface {
// RecordInt64Count records the measurement alongside labels on the int
@ -37,3 +39,16 @@ type MetricsRecorder interface {
// gauge associated with the provided handle.
RecordInt64Gauge(handle *Int64GaugeHandle, incr int64, labels ...string)
}
// Metrics is an experimental legacy alias of the now-stable stats.MetricSet.
// Metrics will be deleted in a future release.
type Metrics = stats.MetricSet
// Metric was replaced by direct usage of strings.
type Metric = string
// NewMetrics is an experimental legacy alias of the now-stable
// stats.NewMetricSet. NewMetrics will be deleted in a future release.
func NewMetrics(metrics ...Metric) *Metrics {
return stats.NewMetricSet(metrics...)
}