Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed unnecessary if
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Rabenhorst <sebastian.rabenhorst@shopify.com>
rabenhorst committed May 5, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent cf47d86 commit eb7b748
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions test/e2e/native_histograms_test.go
Original file line number Diff line number Diff line change
@@ -325,16 +325,14 @@ func writeHistograms(ctx context.Context, now time.Time, name string, histograms
startTime := now.Add(time.Duration(len(histograms)-1) * -30 * time.Second).Truncate(30 * time.Second)
prompbHistograms := make([]prompb.Histogram, 0, len(histograms))

if len(floatHistograms) > 0 {
for i, fh := range floatHistograms {
ts := startTime.Add(time.Duration(i) * 30 * time.Second).UnixMilli()
prompbHistograms = append(prompbHistograms, remote.FloatHistogramToHistogramProto(ts, fh))
}
} else {
for i, h := range histograms {
ts := startTime.Add(time.Duration(i) * 30 * time.Second).UnixMilli()
prompbHistograms = append(prompbHistograms, remote.HistogramToHistogramProto(ts, h))
}
for i, fh := range floatHistograms {
ts := startTime.Add(time.Duration(i) * 30 * time.Second).UnixMilli()
prompbHistograms = append(prompbHistograms, remote.FloatHistogramToHistogramProto(ts, fh))
}

for i, h := range histograms {
ts := startTime.Add(time.Duration(i) * 30 * time.Second).UnixMilli()
prompbHistograms = append(prompbHistograms, remote.HistogramToHistogramProto(ts, h))
}

timeSeriespb := prompb.TimeSeries{

0 comments on commit eb7b748

Please sign in to comment.