Files
opencloud/vendor/go-micro.dev/v4/debug/profile/profile.go
Jörn Friedrich Dreyer 5ed57cc09a Bump reva deps (#8412)
* bump dependencies

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

* bump reva and add config options

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>

---------

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-02-21 10:20:36 +01:00

44 lines
602 B
Go

// Package profile is for profilers
package profile
type Profile interface {
// Start the profiler
Start() error
// Stop the profiler
Stop() error
// Name of the profiler
String() string
}
var (
DefaultProfile Profile = new(noop)
)
type noop struct{}
func (p *noop) Start() error {
return nil
}
func (p *noop) Stop() error {
return nil
}
func (p *noop) String() string {
return "noop"
}
type Options struct {
// Name to use for the profile
Name string
}
type Option func(o *Options)
// Name of the profile.
func Name(n string) Option {
return func(o *Options) {
o.Name = n
}
}