util

package
v1.247349.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Measurement_Key              = "measurement"
	Collect_Interval_Key         = "metrics_collection_interval"
	Collect_Interval_Mapped_Key  = "interval"
	Aggregation_Interval_Key     = "metrics_aggregation_interval"
	Append_Dimensions_Key        = "append_dimensions"
	Append_Dimensions_Mapped_Key = "tags"
	Windows_Object_Name_Key      = "ObjectName"
	Windows_Measurement_Key      = "Measurement"
	Windows_WarnOnMissing_Key    = "WarnOnMissing"
	Windows_Disable_Replacer_Key = "DisableReplacer"
)
View Source
const (
	Report_deltas_Key            = "report_deltas"
	Tags_Key                     = "tags"
	True_value                   = "true"
	Ignored_fields_for_delta     = "iops_in_progress"
	Ignored_fields_for_delta_Key = "ignored_fields_for_delta"
)
View Source
const Asterisk_Key = "*"
View Source
const Disabled_Instance_Val_Windows = "------"
View Source
const Mapped_Instance_Key_Windows = "Instances"
View Source
const Metric_High_Resolution_Threhold = 60 * time.Second
View Source
const Resource_Key = "resources"

Variables

This section is empty.

Functions

func ApplyMeasurementRule

func ApplyMeasurementRule(inputs interface{}, pluginName string, targetOs string, path string) (returnKey string, returnVal []string)

func ApplyMeasurementRuleForMetricDecoration

func ApplyMeasurementRuleForMetricDecoration(inputs interface{}, pluginName string, targetOs string) (returnVal []interface{})

func ContainAsterisk

func ContainAsterisk(input interface{}, fieldKey string) bool

If the input map contain instance_key, but the vale is not a string list A panic will be thrown

func GetMeasurementName

func GetMeasurementName(input interface{}) (measurementNames []string)

"measurement": [

{"name": "cpu_usage_idle", "rename": "CPU_USAGE_IDLE", "unit": "unit"},
{"name": "cpu_usage_nice", "unit": "unit"},
"cpu_usage_guest",
"time_active",
"usage_active"

]

func InstanceDisabled

func InstanceDisabled(pluginName string) bool

func IsHighResolution

func IsHighResolution(intervalVal string) bool

func ListContains

func ListContains(inputs []string, desiredVal string) bool

check if desiredVal exist in inputs list

func ProcessLinuxCommonConfig

func ProcessLinuxCommonConfig(input interface{}, pluginName string, path string, result map[string]interface{}) bool

ProcessLinuxCommonConfig is used by both Linux and Darwin.

func ProcessMetricsAggregationInterval

func ProcessMetricsAggregationInterval(input interface{}, defaultValue, pluginName string) (returnKey string, returnVal interface{})

func ProcessMetricsCollectionInterval

func ProcessMetricsCollectionInterval(input interface{}, defaultValue, pluginName string) (returnKey string, returnVal interface{})

func ProcessReportDeltasForDiskIO

func ProcessReportDeltasForDiskIO(input interface{}, result map[string]interface{})

func ProcessReportDeltasForNet

func ProcessReportDeltasForNet(input interface{}, result map[string]interface{})

func ProcessWindowsCommonConfig

func ProcessWindowsCommonConfig(input interface{}, pluginName string, path string) (returnVal map[string]interface{})

Windows common config returnVal would be three parts: 1. interval: Collect_Interval_Mapped_Key 2. tags: Append_Dimensions_Mapped_Key 3. object config

Types

type MetricArray

type MetricArray []interface{}

func (MetricArray) Len

func (mArray MetricArray) Len() int

func (MetricArray) Less

func (mArray MetricArray) Less(i, j int) bool

func (MetricArray) Swap

func (mArray MetricArray) Swap(i, j int)

Jump to

Keyboard shortcuts

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