ssmetrics

package
v0.0.0-...-a1208dc Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package ssmetrics collect metrics from ss

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregateStatistics

func AggregateStatistics(localDomainName string, clusterResults map[string]float64, networkResults []map[string]string, aggregationMetrics map[string]string, dstDomain string, MonitorPeriods uint) (map[string]float64, error)

AggregateStatistics aggregate statistics using an aggregation function

func Alert

func Alert(metric float64, threshold float64) bool

Alert an alert function that reports whether a metric value exceeds a given threshold

func Avg

func Avg(metrics []map[string]string, key string) (float64, error)

Avg an aggregation function to calculate the average of two network metrics

func Filter

func Filter(ssMetrics []map[string]string, srcIP string, dstIP string, srcPort string, dstPort string, protoNum string) []map[string]string

Filter filter network flows according to given five-tuple rules

func GetMetricChange

func GetMetricChange(lastMetricValues map[string]float64, currentMetricValues map[string]float64) (map[string]float64, map[string]float64)

GetMetricChange get the change values of metrics

func GetSsMetricResults

func GetSsMetricResults(runMode pkgcom.RunModeType, localDomainName string, clusterAddresses map[string][]string, AggregationMetrics map[string]string, MonitorPeriods uint) (map[string]float64, error)

GetSsMetricResults Get the results of ss statistics after filtering

func GetStatisticFromSs

func GetStatisticFromSs() ([]map[string]string, error)

GetStatisticFromSs get the statistics of network flows from ss

func Max

func Max(metrics []map[string]string, key string) (float64, error)

Max an aggregation function to calculate the maximum of two network metrics

func Min

func Min(metrics []map[string]string, key string) (float64, error)

Min an aggregation function to calculate the minimum of two network metrics

func Rate

func Rate(metric1 float64, metric2 float64) float64

Rate an aggregation function to calculate the rate of a network metric between to metrics

func Sum

func Sum(metrics []map[string]string, key string) (float64, error)

Sum an aggregation function to sum up two network metrics

Types

This section is empty.

Jump to

Keyboard shortcuts

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