Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type History ¶
type History struct { CurrentPhase int `json:"currentPhase"` HistoricStates []map[string]string `json:"historicStates"` PeriodPath []int `json:"periodPath"` NextState map[string]string `json:"nextState"` }
History defines the historic path and next step for tspredictor
func ReadHistoryFromFile ¶
ReadHistoryFromFile reads History from json file and returns as object
type PeriodTree ¶
type PeriodTree struct {
Root PeriodTreeNode `json:"root"`
}
PeriodTree contains the root of a PeriodTree
func NewPeriodTree ¶
func NewPeriodTree(size []int) PeriodTree
NewPeriodTree instantiates and returns a new PeriodTree with the `size` child nodes
func (*PeriodTree) GetNode ¶
func (periodTree *PeriodTree) GetNode(path []int) *PeriodTreeNode
GetNode returns the TreeNode which is located at `path`
type PeriodTreeNode ¶
type PeriodTreeNode struct { UUID int MaxChilds int `json:"maxChilds"` MaxCounts int `json:"maxCounts"` Children []PeriodTreeNode `json:"children"` TxMatrix []TxMatrix `json:"txmatrix"` }
PeriodTreeNode describes a node holding a TxMatrix and (if not leaf node) children
func NewPeriodTreeNode ¶
func NewPeriodTreeNode(size []int) PeriodTreeNode
NewPeriodTreeNode instantiates and returns a PeriodTreeNode with `size` children (recursively)
func (*PeriodTreeNode) GetNode ¶
func (periodTreeNode *PeriodTreeNode) GetNode(path []int) *PeriodTreeNode
GetNode returns the TreeNode which is located at `path`
type Phases ¶
type Phases struct { // A list of detected phases (outer array) for each metric (inner array) Phases [][]TxMatrix `json:"phases"` // Tx holds the transitions between the phases Tx TxMatrix `json:"tx"` }
Phases holds a list of detected phases and a tx matrix describing the transitioning between these phases
type Settings ¶
type Settings struct { // BufferSize defines the amount of TSData items before a new state is transitioned BufferSize int `json:"buffersize"` // Name allows to identify the profiler, e.g. for human readable differentiation Name string `json:"-"` // States defines the amount of states to discretize the measurements States int `json:"states"` // History defines the amount of previous, historic state changes to be considered History int `json:"history"` // FilterStdDevs defines the amount of stddevs which are max. allowed for data items before skipped as outliers FilterStdDevs int `json:"filterstddevs"` // FixBound defines if min/max are fixed or dynamic depending on occurred values FixBound bool `json:"fixbound"` // OutputFreq controls the frequency in which the profiler calls the OutputCallback function (if not set, profile has to be retrieved manually) OutputFreq time.Duration `json:"-"` // OutputCallback defines the callback function for `TSProfile`s every `OutputFreq` OutputCallback func(data TSProfile) `json:"-"` // PeriodSize defines the amount and size of periods PeriodSize []int `json:"periodsize"` // Phase Change Detection settings (likeliness over history) PhaseChangeLikeliness float32 `json:"phaseChangeLikeliness"` // Phase Change Detection settings (state history length) PhaseChangeHistory int64 `json:"phaseChangeHistory"` // Phase Change Detection settings (state history fade out) PhaseChangeHistoryFadeout bool `json:"phaseChangeHistoryFadeout"` }
Settings defines settings for TSProfiler
type TSBuffer ¶
type TSBuffer struct { Metric string RawData []float64 Min float64 Max float64 FixedMin float64 FixedMax float64 }
TSBuffer describes one full buffer
func NewTSBuffer ¶
NewTSBuffer instantiates a new TSBuffer with given metric name
type TSInput ¶
type TSInput struct {
Metrics []TSInputMetric `json:"metrics"`
}
TSInput describes a ts data point used as profiler input with a metrics array
type TSInputMetric ¶
TSInputMetric describes profiler input for a single metric
type TSProfile ¶
type TSProfile struct { Name string `json:"name"` RootTx []TxMatrix `json:"roottx"` PeriodTree PeriodTree `json:"periodTree"` Phases Phases `json:"phases"` Settings Settings `json:"settings"` }
TSProfile contains the resulting statistical profile
func (*TSProfile) Likeliness ¶
Likeliness returns how likely [0,1] the current value appears according to the root tx matrix
type TSStats ¶
type TSStats struct { Min float64 `json:"min"` Max float64 `json:"max"` Stddev float64 `json:"stddev"` Avg float64 `json:"avg"` Count int64 `json:"count"` StddevSum float64 `json:"stddevsum"` }
TSStats contains default statistics
type TxMatrix ¶
type TxMatrix struct { Metric string `json:"metric"` Transitions map[string]TXStep `json:"transitions"` Stats TSStats `json:"stats"` }
TxMatrix describes for one metric a statistical profile
func (*TxMatrix) Diff ¶
Diff compares two txMatrizes and returns the diff ratio between 0 (not equal) and 1 (fully equal)
func (*TxMatrix) Likeliness ¶
Likeliness computes the likeliness for transitioning from the from state to the to state