metrics

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelSource   = "source"
	LabelInstance = "instance"

	LabelNameType  = "type"
	LabelValuePaid = "paid"
	LabelValueFree = "free"

	FailureKindNet = "net"
	FailureKindRPC = "rpc"
)

Variables

View Source
var (
	IAPIAuthSuccessDurations = promauto.NewHistogram(prometheus.HistogramOpts{
		Namespace: nsIAPI,
		Subsystem: "auth",
		Name:      "success_seconds",
		Help:      "Time to successful authentication",
	})
	IAPIAuthFailedDurations = promauto.NewHistogram(prometheus.HistogramOpts{
		Namespace: nsIAPI,
		Subsystem: "auth",
		Name:      "failed_seconds",
		Help:      "Time to failed authentication response",
	})

	ProxyCallDurations = promauto.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: nsProxy,
			Subsystem: "calls",
			Name:      "total_seconds",
			Help:      "Method call latency distributions",
			Buckets:   callsSecondsBuckets,
		},
		[]string{"method", "endpoint"},
	)
	ProxyCallFailedDurations = promauto.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: nsProxy,
			Subsystem: "calls",
			Name:      "failed_seconds",
			Help:      "Failed method call latency distributions",
			Buckets:   callsSecondsBuckets,
		},
		[]string{"method", "endpoint", "kind"},
	)

	LbrynetWalletsLoaded = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: nsLbrynet,
		Subsystem: "wallets",
		Name:      "count",
		Help:      "Number of wallets currently loaded",
	}, []string{LabelSource})

	UIBufferCount = promauto.NewCounter(prometheus.CounterOpts{
		Namespace: nsUI,
		Subsystem: "content",
		Name:      "buffer_count",
		Help:      "Video buffer events",
	})
	UITimeToStart = promauto.NewHistogram(prometheus.HistogramOpts{
		Namespace: nsUI,
		Subsystem: "content",
		Name:      "time_to_start",
		Help:      "How long it takes the video to start",
		Buckets:   []float64{0.1, 0.25, 0.5, 1, 2, 4, 8, 16, 32},
	})

	LbrytvCallDurations = promauto.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: nsLbrytv,
			Subsystem: "calls",
			Name:      "total_seconds",
			Help:      "How long do calls to lbrytv take (end-to-end)",
			Buckets:   callsSecondsBuckets,
		},
		[]string{"path"},
	)

	LbrytvNewUsers = promauto.NewCounter(prometheus.CounterOpts{
		Namespace: nsLbrytv,
		Subsystem: "users",
		Name:      "count",
		Help:      "Total number of new users created in the database",
	})
	LbrytvPurchases = promauto.NewCounter(prometheus.CounterOpts{
		Namespace: nsLbrytv,
		Subsystem: "purchase",
		Name:      "count",
		Help:      "Total number of purchases done",
	})
	LbrytvPurchaseAmounts = promauto.NewHistogram(prometheus.HistogramOpts{
		Namespace: nsLbrytv,
		Subsystem: "purchase",
		Name:      "amounts",
		Help:      "Purchase amounts",
		Buckets:   []float64{1, 10, 100, 1000, 10000},
	})
	LbrytvStreamRequests = promauto.NewCounterVec(prometheus.CounterOpts{
		Namespace: nsLbrytv,
		Subsystem: "stream",
		Name:      "count",
		Help:      "Total number of stream requests received",
	}, []string{LabelNameType})

	LbrytvDBOpenConnections = promauto.NewGauge(prometheus.GaugeOpts{
		Namespace: nsLbrytv,
		Subsystem: "db",
		Name:      "conns_open",
		Help:      "Number of open db connections in the Go connection pool",
	})
	LbrytvDBInUseConnections = promauto.NewGauge(prometheus.GaugeOpts{
		Namespace: nsLbrytv,
		Subsystem: "db",
		Name:      "conns_in_use",
		Help:      "Number of in-use db connections in the Go connection pool",
	})
	LbrytvDBIdleConnections = promauto.NewGauge(prometheus.GaugeOpts{
		Namespace: nsLbrytv,
		Subsystem: "db",
		Name:      "conns_idle",
		Help:      "Number of idle db connections in the Go connection pool",
	})
)
View Source
var Logger = monitor.NewModuleLogger("metrics")

Functions

func TrackUIMetric added in v0.11.11

func TrackUIMetric(w http.ResponseWriter, req *http.Request)

Types

type Timer added in v0.11.0

type Timer struct {
	Started  time.Time
	Duration float64
	// contains filtered or unexported fields
}

func TimerStart added in v0.11.0

func TimerStart() *Timer

func (*Timer) Done added in v0.11.0

func (t *Timer) Done() float64

func (*Timer) Observe added in v0.11.2

func (t *Timer) Observe(hist prometheus.Histogram) *Timer

func (*Timer) String added in v0.11.2

func (t *Timer) String() string

Jump to

Keyboard shortcuts

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