metrics

package
v0.0.0-...-1b9ae84 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Operation

func Operation(ctx context.Context, command, result string, retry int64, duration time.Duration)

func Request

func Request(ctx context.Context, command, result string, retries int64, duration time.Duration)

func SQLOperation

func SQLOperation(ctx context.Context, query, result string, duration time.Duration)

Types

type Config

type Config struct {
	Enabled  bool          `ini:"enabled"`
	Endpoint string        `ini:"endpoint"`
	Insecure bool          `ini:"insecure"`
	Interval time.Duration `ini:"interval"`
}

type OperationRecorder

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

func (*OperationRecorder) End

func (rec *OperationRecorder) End(ctx context.Context, result string)

type Provider

type Provider interface {
	Shutdown(context.Context) error
}

func Start

func Start(ctx context.Context, cfg Config) Provider

type RequestRecorder

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

func StartRequest

func StartRequest(command string) RequestRecorder

func (*RequestRecorder) End

func (rec *RequestRecorder) End(ctx context.Context, result string)

func (*RequestRecorder) StartOperation

func (rec *RequestRecorder) StartOperation() OperationRecorder

Jump to

Keyboard shortcuts

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