Skip to content

Add factories for SamplingResult #3354

@anuraaga

Description

@anuraaga

We can currently only implement a Sampler by calling SamplingResult.create. For results without attributes, we do return singletons from this method so it doesn't have any real overhead. But it's somewhat annoying to have to call create with a parameter and not so intuitive - every time I do it I still ctrl-click through the method to confirm it's not creating a new object. The alternative of creating a private static final in the Sampler seems redundant vs us providing some factories

SamplingResult.recordAndSample()
SamplingResult.recordOnly()
SamplingResult.drop()

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions