Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix that metrics aggregation @data_points.clear will cause hdps cleared #1532

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ def initialize(
def collect(start_time, end_time)
if @aggregation_temporality == :delta
# Set timestamps and 'move' data point values to result.
hdps = @data_points.each_value do |hdp|
hdps = @data_points.values.map! do |hdp|
hdp.start_time_unix_nano = start_time
hdp.time_unix_nano = end_time
hdp
end
@data_points.clear
hdps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ def initialize(aggregation_temporality: :delta)
def collect(start_time, end_time)
if @aggregation_temporality == :delta
# Set timestamps and 'move' data point values to result.
ndps = @data_points.each_value do |ndp|
ndps = @data_points.values.map! do |ndp|
ndp.start_time_unix_nano = start_time
ndp.time_unix_nano = end_time
ndp
end
@data_points.clear
ndps
Expand Down
Loading