metrics

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package metrics provides the metrics for the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IncAllowed

func IncAllowed()

IncAllowed increments the request allowed count.

func IncDenied

func IncDenied()

IncDenied increments the request denied count.

func IncInvalid

func IncInvalid()

IncInvalid increments the request invalid count.

func Prometheus added in v0.3.3

func Prometheus() string

Prometheus returns metrics formatted in Prometheus exposition format.

Types

type RequestCount

type RequestCount struct {
	Denied  atomic.Uint64
	Allowed atomic.Uint64
	Invalid atomic.Uint64
}

RequestCount contains the request count.

type RequestCountSnapshot

type RequestCountSnapshot struct {
	Allowed uint64 `json:"allowed"`
	Denied  uint64 `json:"denied"`
	Invalid uint64 `json:"invalid"`
	Total   uint64 `json:"total"`
}

RequestCountSnapshot contains the snapshot of the request count.

type Snapshot

type Snapshot struct {
	Version  string               `json:"version"`
	Requests RequestCountSnapshot `json:"requests"`
}

Snapshot contains the snapshot of the metrics.

func Get

func Get() *Snapshot

Get returns a snapshot of the metrics.

Jump to

Keyboard shortcuts

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