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

Eliminate Measurement class to save on allocations #145

Closed
SergeyKanzhelev opened this issue Jun 20, 2019 · 4 comments
Closed

Eliminate Measurement class to save on allocations #145

SergeyKanzhelev opened this issue Jun 20, 2019 · 4 comments
Assignees
Labels
area:api Cross language API specification issue spec:metrics Related to the specification/metrics directory
Milestone

Comments

@SergeyKanzhelev
Copy link
Member

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

@SergeyKanzhelev SergeyKanzhelev added the area:api Cross language API specification issue label Jun 20, 2019
@SergeyKanzhelev SergeyKanzhelev added this to the API revision: 07-2019 milestone Jun 20, 2019
@jmacd
Copy link
Contributor

jmacd commented Jun 26, 2019

@iredelmeier

@jmacd
Copy link
Contributor

jmacd commented Jul 1, 2019

RFC 0003 would avoid this problem. See issue 169.

@iredelmeier iredelmeier added the spec:metrics Related to the specification/metrics directory label Jul 30, 2019
@SergeyKanzhelev SergeyKanzhelev modified the milestones: API revision: 07-2019, Alpha v0.2 Sep 27, 2019
@tedsuo
Copy link
Contributor

tedsuo commented Oct 4, 2019

@SergeyKanzhelev I believe #250 addresses this issue.

@SergeyKanzhelev
Copy link
Member Author

I believe it is resolved via #299

rockb1017 pushed a commit to rockb1017/opentelemetry-specification that referenced this issue Nov 18, 2021
* Add packaging specification information

Proposal to get Helm chart to 1.0

* Update specification/versioning.md

Co-authored-by: Robert Pająk <[email protected]>

Co-authored-by: Robert Pająk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:api Cross language API specification issue spec:metrics Related to the specification/metrics directory
Projects
None yet
Development

No branches or pull requests

4 participants