stats

package
v0.0.0-...-eb3d71d Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EventPlatformNameTranslations = map[string]string{
	"dbm-samples":                "Database Monitoring Query Samples",
	"dbm-metrics":                "Database Monitoring Query Metrics",
	"dbm-activity":               "Database Monitoring Activity Samples",
	"dbm-metadata":               "Database Monitoring Metadata Samples",
	"network-devices-metadata":   "Network Devices Metadata",
	"network-devices-netflow":    "Network Devices NetFlow",
	"network-devices-snmp-traps": "SNMP Traps",
	"network-path":               "Network Path",
}

EventPlatformNameTranslations contains human readable translations for event platform event types

Functions

func TranslateEventPlatformEventTypes

func TranslateEventPlatformEventTypes(aggregatorStats interface{}) (interface{}, error)

TranslateEventPlatformEventTypes translates the event platform event types in aggregator stats to human readable names

Types

type SenderStats

type SenderStats struct {
	MetricSamples    int64
	Events           int64
	ServiceChecks    int64
	HistogramBuckets int64
	// EventPlatformEvents tracks the number of events submitted for each eventType
	EventPlatformEvents map[string]int64
	// LongRunningCheck is a field that is only set for long running checks
	// converted to a normal check
	LongRunningCheck bool
}

SenderStats contains statistics showing the count of various types of telemetry sent by a check sender

func NewSenderStats

func NewSenderStats() SenderStats

NewSenderStats creates a new SenderStats

func (SenderStats) Copy

func (s SenderStats) Copy() (result SenderStats)

Copy creates a copy of the current SenderStats

type Stats

type Stats struct {
	CheckName         string
	CheckVersion      string
	CheckConfigSource string
	CheckID           checkid.ID
	Interval          time.Duration
	// LongRunning is true if the check is a long running check
	// converted to a normal check
	LongRunning              bool
	Cancelling               bool
	TotalRuns                uint64
	TotalErrors              uint64
	TotalWarnings            uint64
	MetricSamples            int64
	Events                   int64
	ServiceChecks            int64
	HistogramBuckets         int64
	TotalMetricSamples       uint64
	TotalEvents              uint64
	TotalServiceChecks       uint64
	TotalHistogramBuckets    uint64
	EventPlatformEvents      map[string]int64
	TotalEventPlatformEvents map[string]int64
	ExecutionTimes           [32]int64 // circular buffer of recent run durations, most recent at [(TotalRuns+31) % 32]
	AverageExecutionTime     int64     // average run duration
	LastExecutionTime        int64     // most recent run duration, provided for convenience
	LastSuccessDate          int64     // most recent successful execution date, unix timestamp in seconds
	LastError                string    // error that occurred in the last run, if any
	LastDelay                int64     // most recent check start time delay relative to the previous check run, in seconds
	LastWarnings             []string  // warnings that occurred in the last run, if any
	UpdateTimestamp          int64     // latest update to this instance, unix timestamp in seconds

	Telemetry bool // do we want telemetry on this Check
	// contains filtered or unexported fields
}

Stats holds basic runtime statistics about check instances

func NewStats

func NewStats(c StatsCheck) *Stats

NewStats returns a new check stats instance

func (*Stats) Add

func (cs *Stats) Add(t time.Duration, err error, warnings []error, metricStats SenderStats)

Add tracks a new execution time

func (*Stats) SetStateCancelling

func (cs *Stats) SetStateCancelling()

SetStateCancelling sets the check stats to be in a cancelling state

type StatsCheck

type StatsCheck interface {
	// String provides a printable version of the check name
	String() string
	// ID provides a unique identifier for every check instance
	ID() checkid.ID
	// Version returns the version of the check if available
	Version() string
	//Interval returns the interval time for the check
	Interval() time.Duration
	// ConfigSource returns the configuration source of the check
	ConfigSource() string
}

Jump to

Keyboard shortcuts

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