add debug/profile package (#920)

* add debug/profile package

* set service+version for profile
This commit is contained in:
Asim Aslam
2019-11-06 19:36:04 +00:00
committed by GitHub
parent 254045e9f3
commit ce080d76c6
4 changed files with 168 additions and 6 deletions

23
debug/profile/profile.go Normal file
View File

@@ -0,0 +1,23 @@
// Package profile is for profilers
package profile
type Profile interface {
// Start the profiler
Start() error
// Stop the profiler
Stop() error
}
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
}
}