metrics

package
v0.0.0-...-bcbb5c0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2018 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Package metrics exposes promotheus metrics

Index

Constants

This section is empty.

Variables

View Source
var (
	Events = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "csf_events_count",
			Help: "Number of events received",
		},
		[]string{"matched"},
	)

	Reactions = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "csf_reactions_count",
			Help: "Number of reactions executed",
		},
		[]string{"status"},
	)

	Goroutines = prometheus.NewGaugeFunc(
		prometheus.GaugeOpts{
			Subsystem: "runtime",
			Name:      "csf_goroutines_count",
			Help:      "Number of goroutines that currently exist.",
		},
		func() float64 { return float64(runtime.NumGoroutine()) },
	)

	MemUsage = prometheus.NewGaugeFunc(
		prometheus.GaugeOpts{
			Subsystem: "runtime",
			Name:      "csf_mem_allocated_mb",
			Help:      "System memory allocated to csf",
		},
		func() float64 {
			var memStats runtime.MemStats
			runtime.ReadMemStats(&memStats)
			return float64(memStats.Sys / (1024 * 1024))
		},
	)
)

Functions

func ServeMetrics

func ServeMetrics(endpoint string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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