@@ -101,6 +101,7 @@ func (tsm *TimeseriesMap) GC() {
101
101
tsm .Mark = false
102
102
}
103
103
104
+ << << << < HEAD
104
105
// IsResetHistogram compares the given histogram datapoint h, to tsi.Histogram
105
106
// and determines whether the metric has been reset based on the values. It is
106
107
// a reset if any of the bucket boundaries have changed, if any of the bucket
@@ -110,6 +111,13 @@ func (tsi *TimeseriesInfo) IsResetHistogram(h pmetric.HistogramDataPoint) bool {
110
111
return true
111
112
}
112
113
if h .Sum () < tsi .Histogram .Sum () {
114
+ == == == =
115
+ func (tsi * TimeseriesInfo ) IsResetHistogram (h pmetric .HistogramDataPoint ) bool {
116
+ if h .Count () != 0 && tsi .Histogram .Count () != 0 && h .Count () < tsi .Histogram .Count () {
117
+ return true
118
+ }
119
+ if h .Sum () != 0 && tsi .Histogram .Sum () != 0 && h .Sum () < tsi .Histogram .Sum () {
120
+ >> >> >> > a9034e93c8 (metricstarttimeprocessor : add reset detection for histograms )
113
121
return true
114
122
}
115
123
@@ -137,6 +145,7 @@ func (tsi *TimeseriesInfo) IsResetHistogram(h pmetric.HistogramDataPoint) bool {
137
145
return false
138
146
}
139
147
148
+ << << << < HEAD
140
149
// IsResetExponentialHistogram compares the given exponential histogram
141
150
// datapoint eh, to tsi.ExponentialHistogram and determines whether the metric
142
151
// has been reset based on the values. It is a reset if any of the bucket
@@ -148,6 +157,14 @@ func (tsi *TimeseriesInfo) IsResetExponentialHistogram(eh pmetric.ExponentialHis
148
157
return true
149
158
}
150
159
if eh .Sum () < tsi .ExponentialHistogram .Sum () {
160
+ == == == =
161
+ func (tsi * TimeseriesInfo ) IsResetExponentialHistogram (eh pmetric .ExponentialHistogramDataPoint ) bool {
162
+ // Same as the histogram implementation
163
+ if eh .Count () != 0 && tsi .ExponentialHistogram .Count () != 0 && eh .Count () < tsi .ExponentialHistogram .Count () {
164
+ return true
165
+ }
166
+ if eh .Sum () != 0 && tsi .ExponentialHistogram .Sum () != 0 && eh .Sum () < tsi .ExponentialHistogram .Sum () {
167
+ >> >> >> > a9034e93c8 (metricstarttimeprocessor : add reset detection for histograms )
151
168
return true
152
169
}
153
170
@@ -177,6 +194,7 @@ func (tsi *TimeseriesInfo) IsResetExponentialHistogram(eh pmetric.ExponentialHis
177
194
return false
178
195
}
179
196
197
+ << << << < HEAD
180
198
// IsResetSummary compares the given summary datapoint s to tsi.Summary and
181
199
// determines whether the metric has been reset based on the values. It is a
182
200
// reset if the count or sum has decreased.
@@ -187,6 +205,13 @@ func (tsi *TimeseriesInfo) IsResetSummary(s pmetric.SummaryDataPoint) bool {
187
205
// IsResetSum compares the given number datapoint s to tsi.Number and determines
188
206
// whether the metric has been reset based on the values. It is a reset if the
189
207
// value has decreased.
208
+ == == == =
209
+ func (tsi * TimeseriesInfo ) IsResetSummary (s pmetric .SummaryDataPoint ) bool {
210
+ return (s .Count () != 0 && tsi .Summary .Count () != 0 && s .Count () < tsi .Summary .Count ()) ||
211
+ (s .Sum () != 0 && tsi .Summary .Sum () != 0 && s .Sum () < tsi .Summary .Sum ())
212
+ }
213
+
214
+ >> >> >> > a9034e93c8 (metricstarttimeprocessor : add reset detection for histograms )
190
215
func (tsi * TimeseriesInfo ) IsResetSum (s pmetric .NumberDataPoint ) bool {
191
216
return s .DoubleValue () < tsi .Number .DoubleValue ()
192
217
}
0 commit comments