drain

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: AGPL-3.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 Chunk

type Chunk struct {
	Samples []logproto.PatternSample
}

func (Chunk) ForRange

func (c Chunk) ForRange(start, end model.Time) []logproto.PatternSample

ForRange returns samples with only the values in the given range [start:end). start and end are in milliseconds since epoch.

type Chunks

type Chunks []Chunk

func (*Chunks) Add

func (c *Chunks) Add(ts model.Time)

func (Chunks) Iterator

func (c Chunks) Iterator(pattern string, from, through model.Time) iter.Iterator

type Config

type Config struct {
	LogClusterDepth int
	SimTh           float64
	MaxChildren     int
	ExtraDelimiters []string
	MaxClusters     int
	ParamString     string
	// contains filtered or unexported fields
}

func DefaultConfig

func DefaultConfig() *Config

type Drain

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

func New

func New(config *Config) *Drain

func (*Drain) Clusters

func (d *Drain) Clusters() []*LogCluster

func (*Drain) Delete

func (d *Drain) Delete(cluster *LogCluster)

func (*Drain) Match

func (d *Drain) Match(content string) *LogCluster

Match against an already existing cluster. Match shall be perfect (sim_th=1.0). New cluster will not be created as a result of this call, nor any cluster modifications.

func (*Drain) PatternString

func (d *Drain) PatternString(c *LogCluster) string

func (*Drain) Train

func (d *Drain) Train(content string, ts int64) *LogCluster

func (*Drain) TrainPattern

func (d *Drain) TrainPattern(content string, samples []*logproto.PatternSample) *LogCluster

func (*Drain) TrainTokens

func (d *Drain) TrainTokens(tokens []string, stringer func([]string) string, ts int64) *LogCluster

type LogCluster

type LogCluster struct {
	Size     int
	Tokens   []string
	Stringer func([]string) string
	Chunks   Chunks
	// contains filtered or unexported fields
}

func (*LogCluster) Iterator

func (c *LogCluster) Iterator(from, through model.Time) iter.Iterator

func (*LogCluster) Prune

func (c *LogCluster) Prune(olderThan time.Duration)

func (*LogCluster) Samples

func (c *LogCluster) Samples() []*logproto.PatternSample

func (*LogCluster) String

func (c *LogCluster) String() string

type LogClusterCache

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

func (*LogClusterCache) Get

func (c *LogClusterCache) Get(key int) *LogCluster

func (*LogClusterCache) Iterate

func (c *LogClusterCache) Iterate(fn func(*LogCluster) bool)

func (*LogClusterCache) Set

func (c *LogClusterCache) Set(key int, cluster *LogCluster)

func (*LogClusterCache) Values

func (c *LogClusterCache) Values() []*LogCluster

type Node

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

Jump to

Keyboard shortcuts

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