mirror of
https://github.com/golang/go
synced 2024-11-18 18:34:40 -07:00
internal/telemetry/export/ocagent: update usages of BucketOptions to use pointers
This change updates initializations of DistributionValue to pass in a pointer for BucketOptions rather than a value so that the custom MarshalJSON for *BucketOptionsExplicit will be called when marshalling distributions. Updates golang/go#33819 Change-Id: I6d1a393dfa67d626bf5cdd2cfbc0c931d376f60c Reviewed-on: https://go-review.googlesource.com/c/tools/+/208401 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
df8e87c2ce
commit
f774e2e2e5
@ -190,7 +190,7 @@ func distributionToPoints(counts []int64, count int64, sum float64, bucketBounds
|
||||
Sum: sum,
|
||||
// TODO: SumOfSquaredDeviation?
|
||||
Buckets: buckets,
|
||||
BucketOptions: wire.BucketOptionsExplicit{
|
||||
BucketOptions: &wire.BucketOptionsExplicit{
|
||||
Bounds: bucketBounds,
|
||||
},
|
||||
},
|
||||
|
@ -451,7 +451,7 @@ func TestDataToTimeseries(t *testing.T) {
|
||||
Count: 3,
|
||||
},
|
||||
},
|
||||
BucketOptions: wire.BucketOptionsExplicit{
|
||||
BucketOptions: &wire.BucketOptionsExplicit{
|
||||
Bounds: []float64{
|
||||
0, 5, 10,
|
||||
},
|
||||
@ -502,7 +502,7 @@ func TestDataToTimeseries(t *testing.T) {
|
||||
Count: 2,
|
||||
},
|
||||
},
|
||||
BucketOptions: wire.BucketOptionsExplicit{
|
||||
BucketOptions: &wire.BucketOptionsExplicit{
|
||||
Bounds: []float64{
|
||||
0, 5,
|
||||
},
|
||||
@ -753,7 +753,7 @@ func TestDataToPoints(t *testing.T) {
|
||||
Count: 3,
|
||||
},
|
||||
},
|
||||
BucketOptions: wire.BucketOptionsExplicit{
|
||||
BucketOptions: &wire.BucketOptionsExplicit{
|
||||
Bounds: []float64{
|
||||
0, 5, 10,
|
||||
},
|
||||
@ -785,7 +785,7 @@ func TestDataToPoints(t *testing.T) {
|
||||
Count: 6,
|
||||
},
|
||||
},
|
||||
BucketOptions: wire.BucketOptionsExplicit{
|
||||
BucketOptions: &wire.BucketOptionsExplicit{
|
||||
Bounds: []float64{
|
||||
0, 5, 10,
|
||||
},
|
||||
@ -817,7 +817,7 @@ func TestDataToPoints(t *testing.T) {
|
||||
Count: 3,
|
||||
},
|
||||
},
|
||||
BucketOptions: wire.BucketOptionsExplicit{
|
||||
BucketOptions: &wire.BucketOptionsExplicit{
|
||||
Bounds: []float64{
|
||||
0, 5, 10,
|
||||
},
|
||||
@ -849,7 +849,7 @@ func TestDataToPoints(t *testing.T) {
|
||||
Count: 9,
|
||||
},
|
||||
},
|
||||
BucketOptions: wire.BucketOptionsExplicit{
|
||||
BucketOptions: &wire.BucketOptionsExplicit{
|
||||
Bounds: []float64{
|
||||
0, 5, 10,
|
||||
},
|
||||
@ -916,7 +916,7 @@ func TestDistributionToPoints(t *testing.T) {
|
||||
Count: 3,
|
||||
},
|
||||
},
|
||||
BucketOptions: wire.BucketOptionsExplicit{
|
||||
BucketOptions: &wire.BucketOptionsExplicit{
|
||||
Bounds: []float64{
|
||||
0, 5, 10,
|
||||
},
|
||||
|
@ -146,7 +146,10 @@ type BucketOptions interface {
|
||||
tagBucketOptions()
|
||||
}
|
||||
|
||||
func (BucketOptionsExplicit) tagBucketOptions() {}
|
||||
func (*BucketOptionsExplicit) tagBucketOptions() {}
|
||||
|
||||
var _ BucketOptions = (*BucketOptionsExplicit)(nil)
|
||||
var _ json.Marshaler = (*BucketOptionsExplicit)(nil)
|
||||
|
||||
// Declared for the purpose of custom JSON marshalling without cycles.
|
||||
type bucketOptionsExplicitAlias BucketOptionsExplicit
|
||||
|
Loading…
Reference in New Issue
Block a user