metrics

package
v0.20.4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ListCountKey is the name of the key in which we save the list count
	ListCountKey = `listcount`

	// UserCountKey is the name of the key we use to store total users in redis
	UserCountKey = `usercount`

	// NamespaceCountKey is the name of the key we use to store the amount of total namespaces in redis
	NamespaceCountKey = `namespacecount`

	// TaskCountKey is the name of the key we use to store the amount of total tasks in redis
	TaskCountKey = `taskcount`

	// TeamCountKey is the name of the key we use to store the amount of total teams in redis
	TeamCountKey = `teamcount`
)
View Source
const ActiveUsersKey = `activeusers`

ActiveUsersKey is the key used to store active users in redis

View Source
const SecondsUntilInactive = 30

SecondsUntilInactive defines the seconds until a user is considered inactive

Variables

This section is empty.

Functions

func GetCount

func GetCount(key string) (count int64, err error)

GetCount returns the current count from keyvalue

func GetRegistry added in v0.17.0

func GetRegistry() *prometheus.Registry

func InitMetrics

func InitMetrics()

InitMetrics Initializes the metrics

func PushActiveUsers added in v0.14.0

func PushActiveUsers() (err error)

PushActiveUsers pushed the content of the activeUsers map to redis

func SetCount

func SetCount(count int64, key string) error

SetCount sets the list count to a given value

func SetUserActive added in v0.14.0

func SetUserActive(a web.Auth) (err error)

SetUserActive sets a user as active and pushes it to redis

Types

type ActiveUser

type ActiveUser struct {
	UserID   int64
	LastSeen time.Time
}

ActiveUser defines an active user

type ActiveUsers added in v0.14.1

type ActiveUsers struct {
	// contains filtered or unexported fields
}

ActiveUsers is the type used to save active users

Jump to

Keyboard shortcuts

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