Eliminate Measurement class to save on allocations #145
Labels
area:api
Cross language API specification issue
spec:metrics
Related to the specification/metrics directory
Milestone
Current API for recording raw measurements requires to create a measurement, create a list of measurements and, finally, record this list - which in many cases will result in allocation of an object to queue this list.
Even when no SDK present instrumentation will allocate objects. If allocation of a
Measurement
can be eliminated by returning empty measurement when SDK is not present orMeasure
is not being aggregated by any View, creation of a list is still required.A way to eliminate an allocation of a list, but still be able to implement batching may be to create a new class
MeasuresCollection
that can allow torecord
raw primitives - longs and doubles as a set of overridden methods with the different number of arguments.This will also simplify API as
Measurement
class was causing a lot of misunderstanding and confusions. Measure can exposerecord
method directly without the need to create another objectThe text was updated successfully, but these errors were encountered: