report

package
v0.0.0-...-46749fd Latest Latest
Warning

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

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

Documentation

Overview

Package report is a package that reports metrics for the device check

Index

Constants

This section is empty.

Variables

View Source
var EvaluatedSampleDependencies = map[string]bool{
	"memory.usage": true,
	"memory.used":  true,
	"memory.total": true,
	"memory.free":  true,
}

EvaluatedSampleDependencies set of supported memory usage metrics

View Source
var TimeNow = time.Now

TimeNow is the unix time to use for rate (delta) calculations

Functions

This section is empty.

Types

type BandwidthUsage

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

BandwidthUsage tracks the interface's current ifSpeed and last seen sample to generate rate with

type InterfaceBandwidthState

type InterfaceBandwidthState map[string]*BandwidthUsage

InterfaceBandwidthState holds state between runs to be able to calculate rate

func MakeInterfaceBandwidthState

func MakeInterfaceBandwidthState() InterfaceBandwidthState

MakeInterfaceBandwidthState returns a new InterfaceBandwidthState

func (InterfaceBandwidthState) RemoveExpiredBandwidthUsageRates

func (ibs InterfaceBandwidthState) RemoveExpiredBandwidthUsageRates(timestampNano int64)

RemoveExpiredBandwidthUsageRates will go through the map of bandwidth usage rates and remove entries if it hasn't been updated in a given deadline (presumed to be an interface or device taken down if no metrics have been seen in the given amount of time)

type MetricSample

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

MetricSample is a collected metric sample with its metadata, ready to be submitted through the metric sender

type MetricSender

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

MetricSender is a wrapper around sender.Sender

func NewMetricSender

func NewMetricSender(sender sender.Sender, hostname string, interfaceConfigs []snmpintegration.InterfaceConfig, interfaceBandwidthState InterfaceBandwidthState) *MetricSender

NewMetricSender create a new MetricSender

func (*MetricSender) Gauge

func (ms *MetricSender) Gauge(metric string, value float64, tags []string)

Gauge wraps Sender.Gauge

func (*MetricSender) GetCheckInstanceMetricTags

func (ms *MetricSender) GetCheckInstanceMetricTags(metricTags []profiledefinition.MetricTagConfig, values *valuestore.ResultValueStore) []string

GetCheckInstanceMetricTags returns check instance metric tags

func (*MetricSender) GetSubmittedMetrics

func (ms *MetricSender) GetSubmittedMetrics() int

GetSubmittedMetrics returns submitted metrics count

func (*MetricSender) MonotonicCount

func (ms *MetricSender) MonotonicCount(metric string, value float64, tags []string)

MonotonicCount wraps Sender.MonotonicCount

func (*MetricSender) Rate

func (ms *MetricSender) Rate(metric string, value float64, tags []string)

Rate wraps Sender.Rate

func (*MetricSender) ReportMetrics

func (ms *MetricSender) ReportMetrics(metrics []profiledefinition.MetricsConfig, values *valuestore.ResultValueStore, tags []string, deviceID string)

ReportMetrics reports metrics using Sender

func (*MetricSender) ReportNetworkDeviceMetadata

func (ms *MetricSender) ReportNetworkDeviceMetadata(config *checkconfig.CheckConfig, store *valuestore.ResultValueStore, origTags []string, collectTime time.Time, deviceStatus devicemetadata.DeviceStatus, pingStatus devicemetadata.DeviceStatus, diagnoses []devicemetadata.DiagnosisMetadata)

ReportNetworkDeviceMetadata reports device metadata

func (*MetricSender) ServiceCheck

func (ms *MetricSender) ServiceCheck(CheckName string, status servicecheck.ServiceCheckStatus, tags []string, message string)

ServiceCheck wraps Sender.ServiceCheck

Jump to

Keyboard shortcuts

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