You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the changes proposed in #14 we switch from aggregating data when the instruments are recording a data point to aggregating when collection happens by a MetricReader.
That said, we haven't added a way to discard the data points that are collected from the reader.
e.g. in Counter measurementsData
we fetch all the data points from the measurements arraylist, but then we don't remove them from the arraylist, letting it ever growing.
This is similar in all other instruments.
Describe the desired state
We should:
ensure that the collection cycle is thread-safe, because measurementsData could be called from another thread than other modifying it
clean up the items fetched for collection from the state of the instrument
For point 2., we could use toOwnedSlice() but we should first understand if the allocator that is passed as part of the collection is the same used for recording datapoints (unlikely).
If we want to keep a clean separation between the allocators, copying in place the items seems to be simplest solution.
The text was updated successfully, but these errors were encountered:
Describe the current state
With the changes proposed in #14 we switch from aggregating data when the instruments are recording a data point to aggregating when collection happens by a
MetricReader
.That said, we haven't added a way to discard the data points that are collected from the reader.
e.g. in Counter
measurementsData
https://github.com/zig-o11y/opentelemetry-sdk/pull/14/files#diff-888687124bb8e8a88554f63e9b1ff30937ac5aa7f7298b874a3f462d6c568679R210-R219
we fetch all the data points from the
measurements
arraylist, but then we don't remove them from the arraylist, letting it ever growing.This is similar in all other instruments.
Describe the desired state
We should:
measurementsData
could be called from another thread than other modifying itFor point 2., we could use
toOwnedSlice()
but we should first understand if the allocator that is passed as part of the collection is the same used for recording datapoints (unlikely).If we want to keep a clean separation between the allocators, copying in place the items seems to be simplest solution.
The text was updated successfully, but these errors were encountered: