Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update github.com/elastic/apm-data digest to 9180b59 #59

Merged
merged 3 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions aggregators/aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,14 +313,14 @@ func TestAggregateSpanMetrics(t *testing.T) {
Metricset: &modelpb.Metricset{
Name: "service_destination",
Interval: formatDuration(ivl),
DocCount: int64(count),
DocCount: uint64(count),
},
Span: &modelpb.Span{
Name: "service-A:" + destinationX,
DestinationService: &modelpb.DestinationService{
Resource: destinationX,
ResponseTime: &modelpb.AggregatedDuration{
Count: int64(count),
Count: uint64(count),
Sum: durationpb.New(time.Duration(count) * duration),
},
},
Expand All @@ -341,14 +341,14 @@ func TestAggregateSpanMetrics(t *testing.T) {
Metricset: &modelpb.Metricset{
Name: "service_destination",
Interval: formatDuration(ivl),
DocCount: int64(count),
DocCount: uint64(count),
},
Span: &modelpb.Span{
Name: "service-A:" + destinationZ,
DestinationService: &modelpb.DestinationService{
Resource: destinationZ,
ResponseTime: &modelpb.AggregatedDuration{
Count: int64(count),
Count: uint64(count),
Sum: durationpb.New(time.Duration(count) * duration),
},
},
Expand All @@ -369,14 +369,14 @@ func TestAggregateSpanMetrics(t *testing.T) {
Metricset: &modelpb.Metricset{
Name: "service_destination",
Interval: formatDuration(ivl),
DocCount: int64(3 * count),
DocCount: uint64(3 * count),
},
Span: &modelpb.Span{
Name: "service-A:" + destinationZ,
DestinationService: &modelpb.DestinationService{
Resource: destinationZ,
ResponseTime: &modelpb.AggregatedDuration{
Count: int64(3 * count),
Count: uint64(3 * count),
Sum: durationpb.New(time.Duration(3*count) * duration),
},
},
Expand All @@ -397,14 +397,14 @@ func TestAggregateSpanMetrics(t *testing.T) {
Metricset: &modelpb.Metricset{
Name: "service_destination",
Interval: formatDuration(ivl),
DocCount: int64(count),
DocCount: uint64(count),
},
Span: &modelpb.Span{
Name: "service-B:" + destinationZ,
DestinationService: &modelpb.DestinationService{
Resource: destinationZ,
ResponseTime: &modelpb.AggregatedDuration{
Count: int64(count),
Count: uint64(count),
Sum: durationpb.New(time.Duration(count) * duration),
},
},
Expand Down Expand Up @@ -455,13 +455,13 @@ func TestAggregateSpanMetrics(t *testing.T) {
Metricset: &modelpb.Metricset{
Name: "service_destination",
Interval: formatDuration(ivl),
DocCount: int64(count),
DocCount: uint64(count),
},
Span: &modelpb.Span{
Name: "service-A:",
DestinationService: &modelpb.DestinationService{
ResponseTime: &modelpb.AggregatedDuration{
Count: int64(count),
Count: uint64(count),
Sum: durationpb.New(time.Duration(count) * duration),
},
},
Expand Down Expand Up @@ -500,14 +500,14 @@ func TestAggregateSpanMetrics(t *testing.T) {
Metricset: &modelpb.Metricset{
Name: "service_destination",
Interval: formatDuration(ivl),
DocCount: int64(count),
DocCount: uint64(count),
},
Span: &modelpb.Span{
Name: "service-A:" + destinationZ,
DestinationService: &modelpb.DestinationService{
Resource: destinationZ,
ResponseTime: &modelpb.AggregatedDuration{
Count: int64(count),
Count: uint64(count),
Sum: durationpb.New(time.Duration(count) * duration),
},
},
Expand Down Expand Up @@ -896,7 +896,7 @@ func TestAggregateAndHarvest(t *testing.T) {
},
DurationHistogram: &modelpb.Histogram{
Values: []float64{100351},
Counts: []int64{1},
Counts: []uint64{1},
},
},
Service: &modelpb.Service{
Expand Down Expand Up @@ -952,7 +952,7 @@ func TestAggregateAndHarvest(t *testing.T) {
},
DurationHistogram: &modelpb.Histogram{
Values: []float64{100351},
Counts: []int64{1},
Counts: []uint64{1},
},
},
Service: &modelpb.Service{
Expand Down
8 changes: 4 additions & 4 deletions aggregators/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ func svcTxnMetricsToAPMEvent(
baseEvent.Event.SuccessCount = modelpb.SummaryMetricFromVTPool()
}
baseEvent.Event.SuccessCount.Count =
int64(math.Round(metrics.SuccessCount + metrics.FailureCount))
uint64(math.Round(metrics.SuccessCount + metrics.FailureCount))
baseEvent.Event.SuccessCount.Sum = math.Round(metrics.SuccessCount)
}

Expand All @@ -863,7 +863,7 @@ func spanMetricsToAPMEvent(
baseEvent.Metricset = modelpb.MetricsetFromVTPool()
}
baseEvent.Metricset.Name = spanMetricsetName
baseEvent.Metricset.DocCount = int64(math.Round(metrics.Count))
baseEvent.Metricset.DocCount = uint64(math.Round(metrics.Count))
baseEvent.Metricset.Interval = intervalStr

if baseEvent.Span == nil {
Expand All @@ -880,7 +880,7 @@ func spanMetricsToAPMEvent(
modelpb.AggregatedDurationFromVTPool()
}
baseEvent.Span.DestinationService.ResponseTime.Count =
int64(math.Round(metrics.Count))
uint64(math.Round(metrics.Count))
baseEvent.Span.DestinationService.ResponseTime.Sum =
durationpb.New(time.Duration(math.Round(metrics.Sum)))

Expand Down Expand Up @@ -995,7 +995,7 @@ func overflowSpanMetricsToAPMEvent(
baseEvent.Metricset = modelpb.MetricsetFromVTPool()
}
baseEvent.Metricset.Samples = append(baseEvent.Metricset.Samples, sample)
baseEvent.Metricset.DocCount = int64(overflowCount)
baseEvent.Metricset.DocCount = overflowCount
}

func marshalEventGlobalLabels(e *modelpb.APMEvent) ([]byte, error) {
Expand Down
6 changes: 3 additions & 3 deletions aggregators/converter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ func createTestServiceTransactionMetric(
Event: &modelpb.Event{
SuccessCount: &modelpb.SummaryMetric{
// test code generates all success events
Count: int64(count),
Count: uint64(count),
Sum: float64(count),
},
},
Expand Down Expand Up @@ -720,7 +720,7 @@ func createTestSpanMetric(
Name: "service_destination",
Interval: formatDuration(ivl),
Samples: metricsetSamples,
DocCount: int64(count),
DocCount: uint64(count),
},
Service: &modelpb.Service{
Name: svcName,
Expand All @@ -732,7 +732,7 @@ func createTestSpanMetric(
Resource: span.Resource,
ResponseTime: &modelpb.AggregatedDuration{
// test code generates 1 count for 1 ns
Count: int64(count),
Count: uint64(count),
Sum: durationpb.New(time.Duration(count)),
},
},
Expand Down
8 changes: 4 additions & 4 deletions aggregators/internal/hdrhistogram/hdrhistogram.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ func (h *HistogramRepresentation) Merge(from *HistogramRepresentation) {

// Buckets converts the histogram into ordered slices of counts
// and values per bar along with the total count.
func (h *HistogramRepresentation) Buckets() (int64, []int64, []float64) {
counts := make([]int64, 0, h.CountsRep.Len())
func (h *HistogramRepresentation) Buckets() (uint64, []uint64, []float64) {
counts := make([]uint64, 0, h.CountsRep.Len())
values := make([]float64, 0, h.CountsRep.Len())

var totalCount int64
var totalCount uint64
var prevBucket int32
iter := h.iterator()
iter.nextCountAtIdx()
Expand All @@ -130,7 +130,7 @@ func (h *HistogramRepresentation) Buckets() (int64, []int64, []float64) {
return
}
if iter.advance(int(bucket - prevBucket)) {
count := int64(math.Round(float64(scaledCounts) / histogramCountScale))
count := uint64(math.Round(float64(scaledCounts) / histogramCountScale))
counts = append(counts, count)
values = append(values, float64(iter.highestEquivalentValue))
totalCount += count
Expand Down
8 changes: 4 additions & 4 deletions aggregators/internal/hdrhistogram/hdrhistogram_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ func TestMerge(t *testing.T) {
}

func TestBuckets(t *testing.T) {
buckets := func(h *hdrhistogram.Histogram) (int64, []int64, []float64) {
buckets := func(h *hdrhistogram.Histogram) (uint64, []uint64, []float64) {
distribution := h.Distribution()
counts := make([]int64, 0, len(distribution))
counts := make([]uint64, 0, len(distribution))
values := make([]float64, 0, len(distribution))

var totalCount int64
var totalCount uint64
for _, b := range distribution {
if b.Count <= 0 {
continue
}
count := int64(math.Round(float64(b.Count) / histogramCountScale))
count := uint64(math.Round(float64(b.Count) / histogramCountScale))
counts = append(counts, count)
values = append(values, float64(b.To))
totalCount += count
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/axiomhq/hyperloglog v0.0.0-20230201085229-3ddf4bad03dc
github.com/cespare/xxhash/v2 v2.2.0
github.com/cockroachdb/pebble v0.0.0-20230627193317-c807f60529a3
github.com/elastic/apm-data v0.1.1-0.20230728063148-1076ea8b4db0
github.com/elastic/apm-data v0.1.1-0.20230803060036-9180b59d7888
github.com/google/go-cmp v0.5.9
github.com/stretchr/testify v1.8.4
go.elastic.co/apm/module/apmotel/v2 v2.4.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ github.com/dgryski/go-metro v0.0.0-20180109044635-280f6062b5bc h1:8WFBn63wegobsY
github.com/dgryski/go-metro v0.0.0-20180109044635-280f6062b5bc/go.mod h1:c9O8+fpSOX1DM8cPNSkX/qsBWdkD4yd2dpciOWQjpBw=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM=
github.com/elastic/apm-data v0.1.1-0.20230728063148-1076ea8b4db0 h1:dJEhfgmABnNyC//PM/CDCEEMg5l6I+KjHGDR6o1WMx4=
github.com/elastic/apm-data v0.1.1-0.20230728063148-1076ea8b4db0/go.mod h1:lMTMoCWNadiDJih/tLechuMTtumEeedtKJlBOYAv030=
github.com/elastic/apm-data v0.1.1-0.20230803060036-9180b59d7888 h1:R2HpM1KxROvzvMHq/3XmuT/Y6oTcTteUFMJtQCP04GM=
github.com/elastic/apm-data v0.1.1-0.20230803060036-9180b59d7888/go.mod h1:lMTMoCWNadiDJih/tLechuMTtumEeedtKJlBOYAv030=
github.com/elastic/go-sysinfo v1.7.1 h1:Wx4DSARcKLllpKT2TnFVdSUJOsybqMYCNQZq1/wO+s0=
github.com/elastic/go-sysinfo v1.7.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6eh0ikPT9F0=
github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6CcloAxnPgU=
Expand Down