metrics

package
v1.2.85 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Begin

func Begin(ctx context.Context)

func End

func End(ctx context.Context)

func EndWithCause

func EndWithCause(ctx context.Context, cause error)

func New added in v1.2.0

func New(reporter Reporter) services.Service

Types

type Event

type Event struct {
	// contains filtered or unexported fields
}

type Metric

type Metric struct {
	Endpoint  string `json:"endpoint" avro:"endpoint"`
	Fn        string `json:"fn" avro:"fn"`
	Latency   int64  `json:"latency" avro:"latency"`
	Succeed   bool   `json:"succeed" avro:"succeed"`
	ErrorCode int    `json:"errorCode" avro:"errorCode"`
	ErrorName string `json:"errorName" avro:"errorName"`
	DeviceId  string `json:"deviceId" avro:"deviceId"`
	DeviceIp  string `json:"deviceIp" avro:"deviceIp"`
	// contains filtered or unexported fields
}

Metric use @metric to enable in fn

type Reporter

type Reporter interface {
	services.Component
	Report(ctx context.Context, metric Metric)
}

Jump to

Keyboard shortcuts

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