expvars

package
v0.0.0-...-bea5de9 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCheckStats

func AddCheckStats(
	c check.Check,
	execTime time.Duration,
	err error,
	warnings []error,
	mStats checkstats.SenderStats,
)

AddCheckStats adds runtime stats to the check's expvars

func AddErrorsCount

func AddErrorsCount(amount int)

AddErrorsCount is used to increment the 'Errors' expvar

func AddRunningCheckCount

func AddRunningCheckCount(amount int)

AddRunningCheckCount is used to increment and decrement the 'RunningChecks' expvar

func AddRunsCount

func AddRunsCount(amount int)

AddRunsCount is used to increment and decrement the 'Runs' expvar

func AddWarningsCount

func AddWarningsCount(amount int)

AddWarningsCount is used to increment the 'Warnings' expvar

func CheckStats

func CheckStats(id checkid.ID) (*checkstats.Stats, bool)

CheckStats returns the check stats of a check, if they can be found

func DeleteRunningStats

func DeleteRunningStats(id checkid.ID)

DeleteRunningStats clears the start time of a check when it's complete

func DeleteWorkerStats

func DeleteWorkerStats(name string)

DeleteWorkerStats is used to remove instance information about a worker and update the count of the curretly running workers

func GetCheckStats

func GetCheckStats() map[string]map[checkid.ID]*checkstats.Stats

GetCheckStats returns the check stats map

func GetErrorsCount

func GetErrorsCount() int64

GetErrorsCount is used to get the value of 'Errors' expvar

func GetRunningCheckCount

func GetRunningCheckCount() int64

GetRunningCheckCount is used to get the value of 'RunningChecks' expvar

func GetRunningStats

func GetRunningStats(id checkid.ID) time.Time

GetRunningStats gets the start time of a running check

func GetRunsCount

func GetRunsCount() int64

GetRunsCount is used to get the value of 'Runs' expvar

func GetWarningsCount

func GetWarningsCount() int64

GetWarningsCount is used to get the value of 'Warnings' expvar

func GetWorkerCount

func GetWorkerCount() int

GetWorkerCount is used to get the value of 'Workers'->'Count' expvar

func RemoveCheckStats

func RemoveCheckStats(checkID checkid.ID)

RemoveCheckStats removes a check from the check stats map

func Reset

func Reset()

Reset clears all stats collected so far (useful in testing)

func SetRunningStats

func SetRunningStats(id checkid.ID, t time.Time)

SetRunningStats sets the start time of a running check

func SetWorkerStats

func SetWorkerStats(name string, ws *WorkerStats)

SetWorkerStats is used to add individual worker stats or update them if they were already present

Types

type WorkerStats

type WorkerStats struct {
	Utilization float64
}

WorkerStats is the update object that will be used to populate the individual `worker.Worker` instance expvar stats

func (*WorkerStats) String

func (ws *WorkerStats) String() string

String is used by expvar package to print the variables

Jump to

Keyboard shortcuts

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