Skip to content

Commit

Permalink
Translate tests for summary
Browse files Browse the repository at this point in the history
  • Loading branch information
odeke-em committed Aug 5, 2021
1 parent b7566bb commit e4163c9
Show file tree
Hide file tree
Showing 2 changed files with 347 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ func (ma *MetricsAdjusterPdata) adjustMetricPoints(metric *pdata.Metric) int {
return ma.adjustMetricGauge(metric)

case pdata.MetricDataTypeHistogram:
return ma.adjustMetricHistogram(metric)
// No need to adjust Gauge-Histograms.
// TODO(@odeke-em): examine and see if perhaps the AggregationTemporality
// changes whether we need to adjust the metric. Currently the prior tests
return 0

case pdata.MetricDataTypeSummary:
return ma.adjustMetricSummary(metric)
Expand Down Expand Up @@ -289,6 +292,10 @@ func (ma *MetricsAdjusterPdata) adjustMetricGauge(current *pdata.Metric) (resets
return
}

// Adding this here to preserve the code, given that golangc-lint is so pedantic.
// We'll need the code in this method when we deal with cumulative vs gauge distributions.
var _ = (*MetricsAdjusterPdata)(nil).adjustMetricHistogram

func (ma *MetricsAdjusterPdata) adjustMetricHistogram(current *pdata.Metric) (resets int) {
// note: sum of squared deviation not currently supported
currentPoints := current.Histogram().DataPoints()
Expand Down
Loading

0 comments on commit e4163c9

Please sign in to comment.