Skip to content

Commit

Permalink
remote getSummaryDataPoint
Browse files Browse the repository at this point in the history
  • Loading branch information
huyan0 committed Aug 31, 2020
1 parent ee55f37 commit 5f7bc69
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
12 changes: 2 additions & 10 deletions exporter/prometheusremotewriteexporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,16 +522,8 @@ func Test_pushMetrics(t *testing.T) {

summary := dataold.MetricDataToOtlp(testdataold.GenerateMetricDataOneMetric())
summary[0].InstrumentationLibraryMetrics[0].Metrics[0] = &otlp.Metric{
MetricDescriptor: getDescriptor("summary_test", summaryComb, validCombinations),
SummaryDataPoints: []*otlp.SummaryDataPoint{getSummaryDataPoint(
lbs1,
time1,
floatVal1,
uint64(intVal1),
[]float64{floatVal1},
[]float64{floatVal2},
),
},
MetricDescriptor: getDescriptor("summary_test", summaryComb, validCombinations),
SummaryDataPoints: []*otlp.SummaryDataPoint{},
}
summaryBatch := pdatautil.MetricsFromOldInternalMetrics(dataold.MetricDataFromOtlp(summary))

Expand Down
18 changes: 0 additions & 18 deletions exporter/prometheusremotewriteexporter/testutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,24 +175,6 @@ func getHistogramDataPoint(labels []*commonpb.StringKeyValue, ts uint64, sum flo
}
}

func getSummaryDataPoint(labels []*commonpb.StringKeyValue, ts uint64, sum float64, count uint64, pcts []float64, values []float64) *otlp.SummaryDataPoint {
pcs := []*otlp.SummaryDataPoint_ValueAtPercentile{}
for i, v := range values {
pcs = append(pcs, &otlp.SummaryDataPoint_ValueAtPercentile{
Percentile: pcts[i],
Value: v,
})
}
return &otlp.SummaryDataPoint{
Labels: labels,
StartTimeUnixNano: 0,
TimeUnixNano: ts,
Count: count,
Sum: sum,
PercentileValues: pcs,
}
}

// Prometheus TimeSeries
func getPromLabels(lbs ...string) []prompb.Label {
pbLbs := prompb.Labels{
Expand Down

0 comments on commit 5f7bc69

Please sign in to comment.