nodeanalyzer

package
v0.0.0-...-a1d7b1b Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DerivedMetricCalculator

type DerivedMetricCalculator interface {
	GetDerivedMetric(currentTime int64, metricData MetricData) *DerivedMetricResult
}

func NewDerivedMetricCalculator

func NewDerivedMetricCalculator(sampleInterval int64, config *DerivedMetricConfig) (DerivedMetricCalculator, error)

type DerivedMetricConfig

type DerivedMetricConfig struct {
	MetricName           string            `json:"metric_name"`
	Type                 string            `json:"type"`
	Resource             string            `json:"resource"`
	Normalizer           *string           `json:"normalizer,omitempty"`
	ObservationWindowSec int64             `json:"observation_window_sec"`
	Tags                 map[string]string `json:"tags,omitempty"`

	ThresholdConfig *ThresholdBasedConfig `json:"threshold"`
}

type DerivedMetricResult

type DerivedMetricResult struct {
	Name  string
	Value float64
}

type DerivedMetrics

type DerivedMetrics struct {
	States         map[string]DerivedMetricCalculator
	GlobConfigs    []GlobConfig
	SampleInterval int64
}

func NewDerivedMetrics

func NewDerivedMetrics(sampleInterval int64, configs []DerivedMetricConfig) (*DerivedMetrics, error)

func (*DerivedMetrics) ProcessMetric

func (dm *DerivedMetrics) ProcessMetric(currentTime int64, metricData MetricData) (*DerivedMetricResult, error)

type GlobConfig

type GlobConfig struct {
	Config  *DerivedMetricConfig
	Pattern glob.Glob
}

type MetricData

type MetricData struct {
	MetricName     string
	Value          float64
	NodeName       string
	Tags           map[string]string
	NormalizerData float64
}

type NodeAnalyzer

type NodeAnalyzer struct {
	DerivedMetrics    *DerivedMetrics
	NormalizerMapping map[string]string
	// contains filtered or unexported fields
}

func NewAnalyzer

func NewAnalyzer() *NodeAnalyzer

NewProcessor generate processor

func (*NodeAnalyzer) Analyze

func (p *NodeAnalyzer) Analyze(mts []snap.Metric, cfg snap.Config) ([]snap.Metric, error)

func (*NodeAnalyzer) ProcessMetrics

func (p *NodeAnalyzer) ProcessMetrics(mts []snap.Metric) ([]snap.Metric, error)

type ThresholdBasedConfig

type ThresholdBasedConfig struct {
	Type  string  `json:"type"`
	Value float64 `json:"value"`
	Unit  string  `json:"unit"`
}

type ThresholdBasedState

type ThresholdBasedState struct {
	MetricName          string
	DerivedMetricConfig *DerivedMetricConfig
	SampleInterval      int64
	WindowStateHit      *WindowStateHit
}

func NewThresholdBasedState

func NewThresholdBasedState(sampleInterval int64, config *DerivedMetricConfig) *ThresholdBasedState

func (*ThresholdBasedState) GetDerivedMetric

func (tbs *ThresholdBasedState) GetDerivedMetric(currentTime int64, metricData MetricData) *DerivedMetricResult

type ThresholdFrequencyResult

type ThresholdFrequencyResult struct {
	Value      float64
	Hits       int64
	Count      int64
	TotalCount int64
}

type WindowStateHit

type WindowStateHit struct {
	Hits         int64
	HitStartTime int64
	WindowTime   int64
	Count        int64
	TotalCount   int64
}

Jump to

Keyboard shortcuts

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