metrics

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppConfig *appconfig.Config = nil

I hate this, but I want to make sure that if we load the app config, I can grab it in metrisc

View Source
var Enabled = true

Functions

func FlushMetrics added in v0.1.116

func FlushMetrics(ctx context.Context) error

Spawns a forked `flyctl metrics send` process that sends metrics to the flyctl-metrics server

func FlushPending

func FlushPending()

func GetMetricsToken added in v0.1.116

func GetMetricsToken(parentCtx context.Context) (token string, err error)

func IsFlushMetricsDisabled added in v0.1.117

func IsFlushMetricsDisabled(ctx context.Context) bool

IsFlushMetricsDisabled returns true if FlushMetrics should not be called after a command completes.

func RecordCommandContext added in v0.0.550

func RecordCommandContext(ctx context.Context)

func RecordCommandFinish added in v0.0.550

func RecordCommandFinish(cmd *cobra.Command, failed bool)

func Send

func Send[T any](ctx context.Context, metricSlug string, value T)

func SendJson

func SendJson(ctx context.Context, metricSlug string, payload json.RawMessage)

func SendMetrics added in v0.1.117

func SendMetrics(ctx context.Context, json string) error

/ Spens up to 15 seconds sending all metrics collected so far to flyctl-metrics post endpoint

func SendNoData

func SendNoData(ctx context.Context, metricSlug string)

func StartTiming

func StartTiming(ctx context.Context, metricSlug string) func()

func Started

func Started(ctx context.Context, metricSlug string)

func Status

func Status(ctx context.Context, metricSlug string, success bool)

func WithDisableFlushMetrics added in v0.1.117

func WithDisableFlushMetrics(ctx context.Context) context.Context

WithDisableFlushMetrics returns a context with a flag that disables FlushMetrics call after a command completes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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