metrics

package
v1.4.15 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEntryToIPSet

func AddEntryToIPSet(setName string)

AddEntryToIPSet increments the number of entries for IPSet setName. It doesn't ever update the number of IPSets.

func CreateTelemetryHandle

func CreateTelemetryHandle(version, aiMetadata string) error

CreateTelemetryHandle creates a handler to initialize AI telemetry

func DecNumACLRules

func DecNumACLRules()

DecNumACLRules decrements the number of ACL rules.

func DecNumIPSets

func DecNumIPSets()

DecNumIPSets decrements the number of IPSets.

func DecNumPolicies

func DecNumPolicies()

DecNumPolicies decrements the number of policies.

func DeleteIPSet

func DeleteIPSet(setName string)

DeleteIPSet decrements the number of IPSets and resets the number of entries for ipset setName to 0.

func GetACLRuleExecCount

func GetACLRuleExecCount() (int, error)

GetACLRuleExecCount returns the number of observations for execution time of adding ACL rules. This function is slow.

func GetHandler

func GetHandler(isNodeLevel bool) http.Handler

GetHandler returns the HTTP handler for the metrics endpoint

func GetIPSetExecCount

func GetIPSetExecCount() (int, error)

GetIPSetExecCount returns the number of observations for execution time of adding IPSets. This function is slow.

func GetNumACLRules

func GetNumACLRules() (int, error)

GetNumACLRules returns the number of ACL rules. This function is slow.

func GetNumEntriesForIPSet

func GetNumEntriesForIPSet(setName string) (int, error)

GetNumEntriesForIPSet returns the number entries for IPSet setName. This function is slow. TODO could use the map if this function needs to be faster. If updated, replace GetNumEntriesForIPSet() with getVecValue() in assertEqualMapAndMetricElements() in ipsets_test.go

func GetNumIPSetEntries

func GetNumIPSetEntries() (int, error)

GetNumIPSetEntries returns the total number of IPSet entries. This function is slow.

func GetNumIPSets

func GetNumIPSets() (int, error)

GetNumIPSets returns the number of IPSets. This function is slow.

func GetNumPolicies

func GetNumPolicies() (int, error)

GetNumPolicies returns the number of policies. This function is slow.

func GetPolicyExecCount added in v1.4.13

func GetPolicyExecCount() (int, error)

GetPolicyExecCount returns the number of observations for execution time of adding policies. This function is slow.

func IncNumACLRules

func IncNumACLRules()

IncNumACLRules increments the number of ACL rules.

func IncNumIPSets

func IncNumIPSets()

IncNumIPSets increments the number of IPSets.

func IncNumPolicies

func IncNumPolicies()

IncNumPolicies increments the number of policies.

func InitializeAll

func InitializeAll()

InitializeAll creates all the Prometheus Metrics. The metrics will be nil before this method is called.

func NumIPSetsIsPositive

func NumIPSetsIsPositive() bool

NumIPSetsIsPositive is true when the number of IPSets is positive. This function is slow. TODO might be more efficient to keep track of the count

func RecordACLRuleExecTime

func RecordACLRuleExecTime(timer *Timer)

RecordACLRuleExecTime adds an observation of execution time for adding an ACL rule. The execution time is from the timer's start until now.

func RecordIPSetExecTime

func RecordIPSetExecTime(timer *Timer)

RecordIPSetExecTime adds an observation of execution time for adding an IPSet. The execution time is from the timer's start until now.

func RecordPolicyExecTime added in v1.4.13

func RecordPolicyExecTime(timer *Timer)

RecordPolicyExecTime adds an observation of execution time for adding a policy. The execution time is from the timer's start until now.

func RemoveAllEntriesFromIPSet

func RemoveAllEntriesFromIPSet(setName string)

RemoveAllEntriesFromIPSet sets the number of entries for ipset setName to 0. It doesn't ever update the number of IPSets.

func RemoveEntryFromIPSet

func RemoveEntryFromIPSet(setName string)

RemoveEntryFromIPSet decrements the number of entries for IPSet setName.

func ResetIPSetEntries

func ResetIPSetEntries()

ResetIPSetEntries sets the number of entries to 0 for all IPSets. It doesn't ever update the number of IPSets.

func ResetNumACLRules

func ResetNumACLRules()

ResetNumACLRules sets the number of ACL rules to 0.

func ResetNumIPSets

func ResetNumIPSets()

ResetNumIPSets sets the number of IPSets to 0.

func ResetNumPolicies

func ResetNumPolicies()

ResetNumPolicies sets the number of policies to 0.

func SendErrorLogAndMetric

func SendErrorLogAndMetric(operationID int, format string, args ...interface{})

SendErrorLogAndMetric is responsible for sending log and error metrics through AI telemetry

func SendLog

func SendLog(report aitelemetry.Report)

SendLog sends log

func SendMetric

func SendMetric(metric aitelemetry.Metric)

SendMetric sends metrics

func SetNumIPSets

func SetNumIPSets(val int)

SetNumIPSets sets the number of IPsets to val.

Types

type Timer

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

Timer is a one-time-use tool for recording time between a start and end point

func StartNewTimer

func StartNewTimer() *Timer

StartNewTimer creates a new Timer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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