metrics

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMinimumRequestThreshold = 1
View Source
const DefaultRequestFailureThresholdPct = 0.50

Variables

View Source
var (
	PcrfCcrInitRequests = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "pcrf_ccr_init_requests_total",
		Help: "Total number of CCR Init requests sent to PCRF",
	})
	PcrfCcrInitSendFailures = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "pcrf_ccr_init_send_failures_total",
		Help: "Total number of CCR Init requests that failed to send to PCRF",
	})
	PcrfCcrUpdateRequests = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "pcrf_ccr_update_requests_total",
		Help: "Total number of CCR Update requests sent to PCRF",
	})
	PcrfCcrUpdateSendFailures = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "pcrf_ccr_update_send_failures_total",
		Help: "Total number of CCR Update requests that failed to send to PCRF",
	})
	PcrfCcrTerminateRequests = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "pcrf_ccr_terminate_requests_total",
		Help: "Total number of CCR terminate requests sent to PCRF",
	})
	PcrfCcrTerminateSendFailures = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "pcrf_ccr_terminate_send_failures_total",
		Help: "Total number of CCR terminate requests that failed to send to PCRF",
	})

	OcsCcrInitRequests = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "ocs_ccr_init_requests_total",
		Help: "Total number of CCR Init requests sent to OCS",
	})
	OcsCcrInitSendFailures = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "ocs_ccr_init_send_failures_total",
		Help: "Total number of CCR Init requests that failed to send to OCS",
	})
	OcsCcrUpdateRequests = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "ocs_ccr_update_requests_total",
		Help: "Total number of CCR Update requests sent to OCS",
	})
	OcsCcrUpdateSendFailures = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "ocs_ccr_update_send_failures_total",
		Help: "Total number of CCR Update requests that failed to send to OCS",
	})
	OcsCcrTerminateRequests = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "ocs_ccr_terminate_requests_total",
		Help: "Total number of CCR terminate requests sent to OCS",
	})
	OcsCcrTerminateSendFailures = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "ocs_ccr_terminate_send_failures_total",
		Help: "Total number of CCR terminate requests that failed to send to OCS",
	})

	GxUnparseableMsg = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "gx_unparseable_msg_total",
		Help: "Total number of gx messages received that cannot be parsed",
	})
	GyUnparseableMsg = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "gy_unparseable_msg_total",
		Help: "Total number of gy messages received that cannot be parsed",
	})

	GxTimeouts = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "gx_timeouts_total",
		Help: "Total number of gx timeouts",
	})
	GyTimeouts = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "gy_timeouts_total",
		Help: "Total number of gy timeouts",
	})

	GxResultCodes = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "gx_result_codes",
			Help: "Gx result codes",
		},
		[]string{"code"},
	)
	GyResultCodes = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "gy_result_codes",
			Help: "Gy result codes",
		},
		[]string{"code"},
	)

	GxSuccessTimestamp = prometheus.NewGauge(prometheus.GaugeOpts{
		Name: "gx_success_timestamp",
		Help: "Timestamp of the last successfully completed gx request",
	})
	GxFailuresSinceLastSuccess = prometheus.NewGauge(prometheus.GaugeOpts{
		Name: "gx_failures_since_last_success",
		Help: "The total number of gx request failures since the last successful request completed",
	})

	GySuccessTimestamp = prometheus.NewGauge(prometheus.GaugeOpts{
		Name: "gy_success_timestamp",
		Help: "Timestamp of the last successfully completed gy request",
	})
	GyFailuresSinceLastSuccess = prometheus.NewGauge(prometheus.GaugeOpts{
		Name: "gy_failures_since_last_success",
		Help: "The total number of gy request failures since the last successful request completed",
	})
)

Prometheus counters are monotonically increasing Counters are reset to zero on service restarts

Functions

func ReportCreateGxSession

func ReportCreateGxSession(err error)

session_controller functions

func ReportCreateGySession

func ReportCreateGySession(err error)

func ReportTerminateGxSession

func ReportTerminateGxSession(err error)

func ReportTerminateGySession

func ReportTerminateGySession(err error)

func UpdateGxRecentRequestMetrics

func UpdateGxRecentRequestMetrics(err error)

Generic metric functions

func UpdateGyRecentRequestMetrics

func UpdateGyRecentRequestMetrics(err error)

Types

type SessionHealthMetrics

type SessionHealthMetrics struct {
	PcrfInitTotal             int64
	PcrfInitSendFailures      int64
	PcrfUpdateTotal           int64
	PcrfUpdateSendFailures    int64
	PcrfTerminateTotal        int64
	PcrfTerminateSendFailures int64
	OcsInitTotal              int64
	OcsInitSendFailures       int64
	OcsUpdateTotal            int64
	OcsUpdateSendFailures     int64
	OcsTerminateTotal         int64
	OcsTerminateSendFailures  int64
	GxTimeouts                int64
	GxUnparseableMsg          int64
	GyTimeouts                int64
	GyUnparseableMsg          int64
}

func GetCurrentHealthMetrics

func GetCurrentHealthMetrics() (*SessionHealthMetrics, error)

func (*SessionHealthMetrics) GetDelta

func (prevMetrics *SessionHealthMetrics) GetDelta(
	currentMetrics *SessionHealthMetrics,
) (*SessionHealthMetrics, error)

type SessionHealthTracker

type SessionHealthTracker struct {
	Metrics                 *SessionHealthMetrics
	RequestFailureThreshold float32
	MinimumRequestThreshold uint32
}

func NewSessionHealthTracker

func NewSessionHealthTracker() *SessionHealthTracker

Jump to

Keyboard shortcuts

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