Skip to content

profiler: use functional options instead of config object #792

@derekperkins

Description

@derekperkins

I'm not a huge fan of config objects, and functional options are used in many other places in these packages. It'd be easier to maintain backwards compatibility. There are already functional options for ClientOption, which could either be applied as a part of a ProfilerOption or sent through on a start func.

func NewProfiler(opts ...ProfilerOption) (*Profiler, error) {
	...
}

func (p *Profiler) Start(opts ...ClientOption) error {
	...
}

Metadata

Metadata

Assignees

Labels

api: cloudprofilerIssues related to the Cloud Profiler API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions