Documentation ¶
Index ¶
- type Fields
- type Options
- func Configure() *Options
- func Global() *Options
- func Send(point Point) *Options
- func SendPayLoad(fields Fields, tags Tags, value float64) *Options
- func SendPayLoadWithPoint(point Point) *Options
- func SendReporter(reporter Reporter) *Options
- func SendReporterPayLoad(point func() Point, interval time.Duration) *Options
- func WithAfter(after func(point Point, success bool)) *Options
- func WithBefore(before func(point Point) Point) *Options
- func WithClient(client *http.Client) *Options
- func WithConfigure(options *Options) *Options
- func WithContext(context context.Context) *Options
- func WithDefaultValue(defaultValue *Point) *Options
- func WithDev(dev bool) *Options
- func WithErrorHandler(errorHandler func(point Point, status int)) *Options
- func WithLog(log log.Logger) *Options
- func WithUrl(url string) *Options
- func (o *Options) AddReporter(point func() Point, interval time.Duration) *Options
- func (o *Options) Send(point Point) *Options
- func (o *Options) SendPayLoad(fields Fields, tags Tags, value float64) *Options
- func (o *Options) SendPayLoadWithPoint(point Point) *Options
- func (o *Options) SendReporter(reporter Reporter) *Options
- func (o *Options) SendReporterPayLoad(point func() Point, interval time.Duration) *Options
- func (o *Options) Start()
- func (o *Options) WithAfter(after func(point Point, success bool)) *Options
- func (o *Options) WithBefore(before func(point Point) Point) *Options
- func (o *Options) WithClient(client *http.Client) *Options
- func (o *Options) WithConfigure(options Options) *Options
- func (o *Options) WithContext(context context.Context) *Options
- func (o *Options) WithDefaultValue(defaultValue *Point) *Options
- func (o *Options) WithErrorHandler(errorHandler func(point Point, status int)) *Options
- func (o *Options) WithLog(log log.Logger) *Options
- func (o *Options) WithUrl(url string) *Options
- type Point
- type Reporter
- type Tags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { // Reporters is an init value. It will Send when call Start method. Reporters []Reporter Dev bool // contains filtered or unexported fields }
Options can be custom configured by Configure or WithConfigure.
func SendPayLoad ¶
SendPayLoad will add a Point to chan with some fields, and only add once. Support chain call.
func SendPayLoadWithPoint ¶
SendPayLoadWithPoint will add a Point to chan with another Point, and only add once. Support chain call.
func SendReporter ¶
SendReporter will add a Point to chan with Interval. Support chain call.
func SendReporterPayLoad ¶
SendReporterPayLoad will add a Point to chan with Interval. Support chain call.
func WithBefore ¶
WithBefore can custom before hook. Support chain call.
func WithClient ¶
WithClient can custom http client. Support chain call.
func WithConfigure ¶
WithConfigure report options and return a exist Options.
func WithContext ¶
WithContext will update contest. Support chain call.
func WithDefaultValue ¶
WithUrl can only update `defaultValue` parameters. Support chain call.
func WithErrorHandler ¶
WithErrorHandler can custom error handle. Support chain call.
func (*Options) AddReporter ¶
AddReporter will add a report to the collection of report. IMPORTANT: This method must be called before the Start. Support chain call.
func (*Options) SendPayLoad ¶
SendPayLoad will add a Point to chan with some fields, and only add once. Support chain call.
func (*Options) SendPayLoadWithPoint ¶
SendPayLoadWithPoint will add a Point to chan with another Point, and only add once.
func (*Options) SendReporter ¶
SendReporter will add a Point to chan with Interval. Support chain call.
func (*Options) SendReporterPayLoad ¶
SendReporterPayLoad will add a Point to chan with Interval. Support chain call.
func (*Options) WithBefore ¶
WithBefore can custom before hook. Support chain call.
func (*Options) WithClient ¶
WithClient can custom http client. Support chain call.
func (*Options) WithConfigure ¶
WithConfigure report options and return a exist Options.
func (*Options) WithContext ¶
WithContext will update contest. Support chain call.
func (*Options) WithDefaultValue ¶
WithUrl can only update `defaultValue` parameters. Support chain call.
func (*Options) WithErrorHandler ¶
WithErrorHandler can custom error handle. Support chain call.
type Point ¶
type Point struct { Name string `json:"name"` Endpoint string `json:"endpoint"` Value float64 `json:"value"` Step int `json:"step"` Fields Fields `json:"fields"` Tags Tags `json:"tags"` Time int64 `json:"time"` }
Point is an immutable structure.
type Reporter ¶
Reporter will send Point at regular intervals.
func ApplicationReporter ¶
ApplicationReporter will report goroutine number and memory with this application. duration is sending Interval.