Skip to content

Commit

Permalink
Modify deprecated setdoubleval method
Browse files Browse the repository at this point in the history
  • Loading branch information
aishyandapalli committed Sep 27, 2022
1 parent e63ebb3 commit 139f831
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions receiver/prometheusreceiver/internal/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func TestMetricBuilderCounters(t *testing.T) {
sum.SetAggregationTemporality(pmetric.MetricAggregationTemporalityCumulative)
sum.SetIsMonotonic(true)
pt0 := sum.DataPoints().AppendEmpty()
pt0.SetDoubleVal(100.0)
pt0.SetDoubleValue(100.0)
pt0.SetStartTimestamp(startTimestamp)
pt0.SetTimestamp(tsNanos)
pt0.Attributes().PutString("foo", "bar")
Expand Down Expand Up @@ -348,27 +348,27 @@ func TestMetricBuilderCounters(t *testing.T) {

e0 := pt0.Exemplars().AppendEmpty()
e0.SetTimestamp(timestampFromMs(1663113420863))
e0.SetDoubleVal(1)
e0.SetDoubleValue(1)
e0.FilteredAttributes().PutString(model.MetricNameLabel, "counter_test")
e0.FilteredAttributes().PutString(model.JobLabel, "job")
e0.FilteredAttributes().PutString(model.InstanceLabel, "instance")
e0.FilteredAttributes().PutString("foo", "bar")

e1 := pt0.Exemplars().AppendEmpty()
e1.SetTimestamp(timestampFromMs(1663113420863))
e1.SetDoubleVal(1)
e1.SetDoubleValue(1)
e1.FilteredAttributes().PutString("foo", "bar")

e2 := pt0.Exemplars().AppendEmpty()
e2.SetTimestamp(timestampFromMs(1663113420863))
e2.SetDoubleVal(1)
e2.SetDoubleValue(1)
e2.FilteredAttributes().PutString("foo", "bar")
e2.SetTraceID([16]byte{0x10, 0xa4, 0x73, 0x65, 0xb8, 0xaa, 0x04, 0xe0, 0x82, 0x91, 0xfa, 0xb9, 0xde, 0xca, 0x84, 0xdb})
e2.SetSpanID([8]byte{0x71, 0x9c, 0xee, 0x4a, 0x66, 0x9f, 0xd7, 0xd1})

e3 := pt0.Exemplars().AppendEmpty()
e3.SetTimestamp(timestampFromMs(1663113420863))
e3.SetDoubleVal(1)
e3.SetDoubleValue(1)
e3.FilteredAttributes().PutString("foo", "bar")
e3.SetTraceID([16]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x41, 0x37, 0xca, 0xb6, 0x6d, 0xc8, 0x80})
e3.SetSpanID([8]byte{0x00, 0x00, 0x00, 0xdf, 0xa4, 0x59, 0x7a, 0x9d})
Expand Down Expand Up @@ -512,7 +512,7 @@ func TestMetricBuilderGauges(t *testing.T) {
m0.SetName("gauge_test")
gauge0 := m0.SetEmptyGauge()
pt0 := gauge0.DataPoints().AppendEmpty()
pt0.SetDoubleVal(100.0)
pt0.SetDoubleValue(100.0)
pt0.SetStartTimestamp(0)
pt0.SetTimestamp(tsNanos)
pt0.Attributes().PutString("foo", "bar")
Expand All @@ -523,7 +523,7 @@ func TestMetricBuilderGauges(t *testing.T) {
m1.SetName("gauge_test")
gauge1 := m1.SetEmptyGauge()
pt1 := gauge1.DataPoints().AppendEmpty()
pt1.SetDoubleVal(90.0)
pt1.SetDoubleValue(90.0)
pt1.SetStartTimestamp(0)
pt1.SetTimestamp(tsPlusIntervalNanos)
pt1.Attributes().PutString("foo", "bar")
Expand Down Expand Up @@ -584,27 +584,27 @@ func TestMetricBuilderGauges(t *testing.T) {

e0 := pt0.Exemplars().AppendEmpty()
e0.SetTimestamp(timestampFromMs(1663350815890))
e0.SetDoubleVal(2)
e0.SetDoubleValue(2)
e0.FilteredAttributes().PutString(model.MetricNameLabel, "counter_test")
e0.FilteredAttributes().PutString(model.JobLabel, "job")
e0.FilteredAttributes().PutString(model.InstanceLabel, "instance")
e0.FilteredAttributes().PutString("foo", "bar")

e1 := pt0.Exemplars().AppendEmpty()
e1.SetTimestamp(timestampFromMs(1663350815890))
e1.SetDoubleVal(2)
e1.SetDoubleValue(2)
e1.FilteredAttributes().PutString("foo", "bar")

e2 := pt0.Exemplars().AppendEmpty()
e2.SetTimestamp(timestampFromMs(1663350815890))
e2.SetDoubleVal(2)
e2.SetDoubleValue(2)
e2.FilteredAttributes().PutString("foo", "bar")
e2.SetTraceID([16]byte{0x10, 0xa4, 0x73, 0x65, 0xb8, 0xaa, 0x04, 0xe0, 0x82, 0x91, 0xfa, 0xb9, 0xde, 0xca, 0x84, 0xdb})
e2.SetSpanID([8]byte{0x71, 0x9c, 0xee, 0x4a, 0x66, 0x9f, 0xd7, 0xd1})

e3 := pt0.Exemplars().AppendEmpty()
e3.SetTimestamp(timestampFromMs(1663350815890))
e3.SetDoubleVal(2)
e3.SetDoubleValue(2)
e3.FilteredAttributes().PutString("foo", "bar")
e3.SetTraceID([16]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x41, 0x37, 0xca, 0xb6, 0x6d, 0xc8, 0x80})
e3.SetSpanID([8]byte{0x00, 0x00, 0x00, 0xdf, 0xa4, 0x59, 0x7a, 0x9d})
Expand Down Expand Up @@ -903,36 +903,36 @@ func TestMetricBuilderHistogram(t *testing.T) {

e0 := pt0.Exemplars().AppendEmpty()
e0.SetTimestamp(timestampFromMs(1663113420863))
e0.SetDoubleVal(1)
e0.SetDoubleValue(1)
e0.FilteredAttributes().PutString(model.MetricNameLabel, "counter_test")
e0.FilteredAttributes().PutString(model.JobLabel, "job")
e0.FilteredAttributes().PutString(model.InstanceLabel, "instance")
e0.FilteredAttributes().PutString("foo", "bar")

e1 := pt0.Exemplars().AppendEmpty()
e1.SetTimestamp(timestampFromMs(1663113420863))
e1.SetDoubleVal(1)
e1.SetDoubleValue(1)
e1.FilteredAttributes().PutString("foo", "bar")
e1.FilteredAttributes().PutString("le", "20")

e2 := pt0.Exemplars().AppendEmpty()
e2.SetTimestamp(timestampFromMs(1663113420863))
e2.SetDoubleVal(1)
e2.SetDoubleValue(1)
e2.FilteredAttributes().PutString("foo", "bar")
e2.FilteredAttributes().PutString("traceid", "e3688e1aa2961786")
e2.SetTraceID([16]byte{0x10, 0xa4, 0x73, 0x65, 0xb8, 0xaa, 0x04, 0xe0, 0x82, 0x91, 0xfa, 0xb9, 0xde, 0xca, 0x84, 0xdb})
e2.SetSpanID([8]byte{0x71, 0x9c, 0xee, 0x4a, 0x66, 0x9f, 0xd7, 0xd1})

e3 := pt0.Exemplars().AppendEmpty()
e3.SetTimestamp(timestampFromMs(1663113420863))
e3.SetDoubleVal(1)
e3.SetDoubleValue(1)
e3.FilteredAttributes().PutString("foo", "bar")
e3.SetTraceID([16]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x41, 0x37, 0xca, 0xb6, 0x6d, 0xc8, 0x80})
e3.SetSpanID([8]byte{0x00, 0x00, 0x00, 0xdf, 0xa4, 0x59, 0x7a, 0x9d})

e4 := pt0.Exemplars().AppendEmpty()
e4.SetTimestamp(timestampFromMs(1663113420863))
e4.SetDoubleVal(1)
e4.SetDoubleValue(1)
e4.FilteredAttributes().PutString("foo", "bar")
e4.FilteredAttributes().PutString("trace_id", "174137cab66dc88")
e4.FilteredAttributes().PutString("span_id", "dfa4597a9")
Expand Down

0 comments on commit 139f831

Please sign in to comment.