Skip to content

Eliminate Measurement class to save on allocations #145

@SergeyKanzhelev

Description

@SergeyKanzhelev

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 or Measure 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 to record 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 expose record method directly without the need to create another object

Metadata

Metadata

Assignees

Labels

area:apiCross language API specification issuespec:metricsRelated to the specification/metrics directory

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions