@@ -139,7 +139,7 @@ init(#view_aggregation{name=Name,
139
139
ExplicitBucketBoundaries = maps :get (explicit_bucket_boundaries , Options , ? DEFAULT_BOUNDARIES ),
140
140
RecordMinMax = maps :get (record_min_max , Options , true ),
141
141
# explicit_histogram_aggregation {key = Key ,
142
- start_time_unix_nano = erlang : system_time ( nanosecond ),
142
+ start_time = opentelemetry : timestamp ( ),
143
143
explicit_bucket_boundaries = ExplicitBucketBoundaries ,
144
144
bucket_counts = new_bucket_counts (ExplicitBucketBoundaries ),
145
145
checkpoint = undefined ,
@@ -177,9 +177,9 @@ aggregate(Table, #view_aggregation{name=Name,
177
177
178
178
checkpoint (Tab , # view_aggregation {name = Name ,
179
179
reader = ReaderId ,
180
- temporality = ? TEMPORALITY_DELTA }, CollectionStartNano ) ->
180
+ temporality = ? TEMPORALITY_DELTA }, CollectionStartTime ) ->
181
181
MS = [{# explicit_histogram_aggregation {key = {Name , '$1' , ReaderId },
182
- start_time_unix_nano = '$9' ,
182
+ start_time = '$9' ,
183
183
explicit_bucket_boundaries = '$2' ,
184
184
record_min_max = '$3' ,
185
185
checkpoint = '_' ,
@@ -190,22 +190,22 @@ checkpoint(Tab, #view_aggregation{name=Name,
190
190
},
191
191
[],
192
192
[{# explicit_histogram_aggregation {key = {{{const , Name }, '$1' , {const , ReaderId }}},
193
- start_time_unix_nano = {const , CollectionStartNano },
193
+ start_time = {const , CollectionStartTime },
194
194
explicit_bucket_boundaries = '$2' ,
195
195
record_min_max = '$3' ,
196
196
checkpoint = {# explicit_histogram_checkpoint {bucket_counts = '$5' ,
197
197
min = '$6' ,
198
198
max = '$7' ,
199
199
sum = '$8' ,
200
- start_time_unix_nano = '$9' }},
200
+ start_time = '$9' }},
201
201
bucket_counts = {const , undefined },
202
202
min = infinity ,
203
203
max = ? MIN_DOUBLE ,
204
204
sum = 0 }}]}],
205
205
_ = ets :select_replace (Tab , MS ),
206
206
207
207
ok ;
208
- checkpoint (_Tab , _ , _CollectionStartNano ) ->
208
+ checkpoint (_Tab , _ , _CollectionStartTime ) ->
209
209
% % no good way to checkpoint the `counters' without being out of sync with
210
210
% % min/max/sum, so may as well just collect them in `collect', which will
211
211
% % also be out of sync, but best we can do right now
@@ -216,7 +216,7 @@ collect(Tab, #view_aggregation{name=Name,
216
216
reader = ReaderId ,
217
217
temporality = Temporality }, CollectionStartTime ) ->
218
218
Select = [{# explicit_histogram_aggregation {key = {Name , '$1' , ReaderId },
219
- start_time_unix_nano = '$2' ,
219
+ start_time = '$2' ,
220
220
explicit_bucket_boundaries = '$3' ,
221
221
record_min_max = '$4' ,
222
222
checkpoint = '$5' ,
@@ -230,10 +230,10 @@ collect(Tab, #view_aggregation{name=Name,
230
230
231
231
% %
232
232
233
- datapoint (CollectionStartNano , # explicit_histogram_aggregation {
233
+ datapoint (CollectionStartTime , # explicit_histogram_aggregation {
234
234
key = {_ , Attributes , _ },
235
235
explicit_bucket_boundaries = Boundaries ,
236
- start_time_unix_nano = StartTimeUnixNano ,
236
+ start_time = StartTime ,
237
237
checkpoint = undefined ,
238
238
bucket_counts = BucketCounts ,
239
239
min = Min ,
@@ -243,8 +243,8 @@ datapoint(CollectionStartNano, #explicit_histogram_aggregation{
243
243
Buckets = get_buckets (BucketCounts , Boundaries ),
244
244
# histogram_datapoint {
245
245
attributes = Attributes ,
246
- start_time_unix_nano = StartTimeUnixNano ,
247
- time_unix_nano = CollectionStartNano ,
246
+ start_time = StartTime ,
247
+ time = CollectionStartTime ,
248
248
count = lists :sum (Buckets ),
249
249
sum = Sum ,
250
250
bucket_counts = Buckets ,
@@ -254,20 +254,20 @@ datapoint(CollectionStartNano, #explicit_histogram_aggregation{
254
254
min = Min ,
255
255
max = Max
256
256
};
257
- datapoint (CollectionStartNano , # explicit_histogram_aggregation {
257
+ datapoint (CollectionStartTime , # explicit_histogram_aggregation {
258
258
key = {_ , Attributes , _ },
259
259
explicit_bucket_boundaries = Boundaries ,
260
260
checkpoint = # explicit_histogram_checkpoint {bucket_counts = BucketCounts ,
261
261
min = Min ,
262
262
max = Max ,
263
263
sum = Sum ,
264
- start_time_unix_nano = StartTimeUnixNano }
264
+ start_time = StartTime }
265
265
}) ->
266
266
Buckets = get_buckets (BucketCounts , Boundaries ),
267
267
# histogram_datapoint {
268
268
attributes = Attributes ,
269
- start_time_unix_nano = StartTimeUnixNano ,
270
- time_unix_nano = CollectionStartNano ,
269
+ start_time = StartTime ,
270
+ time = CollectionStartTime ,
271
271
count = lists :sum (Buckets ),
272
272
sum = Sum ,
273
273
bucket_counts = Buckets ,
0 commit comments