stats

package
v1.0.26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReporterComponent added in v0.14.0

func NewReporterComponent(reporter Reporter) (component service.Component)

func Service

func Service(components ...service.Component) (v service.Service)

Types

type Metric

type Metric struct {
	Service   string        `json:"service" validate:"required" message:"service is required"`
	Fn        string        `json:"fn" validate:"required" message:"fn is required"`
	Succeed   bool          `json:"succeed" validate:"required" message:"succeed is required"`
	ErrorCode int           `json:"errorCode"`
	ErrorName string        `json:"errorName"`
	Latency   time.Duration `json:"latency" validate:"required" message:"latency is required"`
}

type Reporter

type Reporter interface {
	Build(options ReporterOptions) (err error)
	Report(ctx context.Context, metric *Metric) (err error)
	Close()
}

type ReporterOptions

type ReporterOptions struct {
	Log    logs.Logger
	Config configures.Config
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL