test

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLogByFields

func CreateLogByFields(fields map[string]string) *protocol.Log

func CreateLogs

func CreateLogs(kvs ...string) *protocol.Log

func GetTestConfig

func GetTestConfig(configName string) string

func LoadDefaultConfig

func LoadDefaultConfig() *pluginmanager.LogstoreConfig

func LoadMockConfig

func LoadMockConfig(project, logstore, configName, jsonStr string) *pluginmanager.LogstoreConfig

project, logstore, config, jsonStr

func PluginStart

func PluginStart() error

func PluginStop

func PluginStop(forceFlushFlag bool) error

Types

type MockCollector

type MockCollector struct {
	Logs    []*MockLog
	RawLogs []*protocol.Log
}

func (*MockCollector) AddData

func (c *MockCollector) AddData(
	tags map[string]string, fields map[string]string, t ...time.Time)

func (*MockCollector) AddDataArray

func (c *MockCollector) AddDataArray(
	tags map[string]string, columns []string, values []string, t ...time.Time)

func (*MockCollector) AddDataArrayWithContext added in v1.1.2

func (c *MockCollector) AddDataArrayWithContext(
	tags map[string]string, columns []string, values []string, ctx map[string]interface{}, t ...time.Time)

func (*MockCollector) AddDataWithContext added in v1.1.2

func (c *MockCollector) AddDataWithContext(
	tags map[string]string, fields map[string]string, ctx map[string]interface{}, t ...time.Time)

func (*MockCollector) AddRawLog

func (c *MockCollector) AddRawLog(log *protocol.Log)

func (*MockCollector) AddRawLogWithContext added in v1.1.2

func (c *MockCollector) AddRawLogWithContext(log *protocol.Log, ctx map[string]interface{})

type MockLog

type MockLog struct {
	Tags   map[string]string
	Fields map[string]string
}

type MockMetricCollector

type MockMetricCollector struct {
	Logs    []*protocol.Log
	Tags    map[string]string
	RawLogs []*protocol.Log
	// Benchmark switch ignore the cpu and memory performance influences when opening.
	Benchmark bool
}

func (*MockMetricCollector) AddData

func (m *MockMetricCollector) AddData(tags map[string]string, fields map[string]string, t ...time.Time)

func (*MockMetricCollector) AddDataArray

func (m *MockMetricCollector) AddDataArray(tags map[string]string, columns []string, values []string, t ...time.Time)

func (*MockMetricCollector) AddDataArrayWithContext added in v1.1.2

func (m *MockMetricCollector) AddDataArrayWithContext(tags map[string]string, columns []string, values []string, ctx map[string]interface{}, t ...time.Time)

func (*MockMetricCollector) AddDataWithContext added in v1.1.2

func (m *MockMetricCollector) AddDataWithContext(tags map[string]string, fields map[string]string, ctx map[string]interface{}, t ...time.Time)

func (*MockMetricCollector) AddRawLog

func (m *MockMetricCollector) AddRawLog(log *protocol.Log)

func (*MockMetricCollector) AddRawLogWithContext added in v1.1.2

func (m *MockMetricCollector) AddRawLogWithContext(log *protocol.Log, ctx map[string]interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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