parsers

package
v0.0.0-...-ff000d2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectEventsData

func CollectEventsData(events []data.LogEvent) []data.Event

CollectEventsData collect data from events logs.

func CollectLogs

func CollectLogs(params data.ParseParams) ([]string, error)

func FormatBytes

func FormatBytes(bytes uint64) string

FormatBytes formats bytes to human-readable format

func GetMemStats

func GetMemStats() runtime.MemStats

GetMemStats returns current memory statistics

func LocalEvents

func LocalEvents(params data.ParseParams) error

func ParseFiles

func ParseFiles(ctx context.Context, files []string) []data.LogEvent

ParseFiles parses log files in parallel using a worker pool

func ParseFilesSequential

func ParseFilesSequential(ctx context.Context, files []string) []data.LogEvent

ParseFilesSequential parses files sequentially (legacy fallback)

func ParseFilesStreaming

func ParseFilesStreaming(ctx context.Context, files []string, workers int) []data.LogEvent

ParseFilesStreaming parses files in streaming mode and returns all events This is a convenience wrapper that collects all events

func ParseFilesWithWorkers

func ParseFilesWithWorkers(ctx context.Context, files []string, workers int) []data.LogEvent

ParseFilesWithWorkers parses log files in parallel with specified number of workers If workers <= 0, uses runtime.NumCPU()

func PrintMemoryStats

func PrintMemoryStats(label string)

PrintMemoryStats prints current memory usage

func RemoteEvents

func RemoteEvents(params data.ParseParams) error

Types

type StreamingParser

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

StreamingParser manages streaming log parsing with memory efficiency

func NewStreamingParser

func NewStreamingParser(ctx context.Context, files []string, workers int) *StreamingParser

NewStreamingParser creates a new streaming parser

func (*StreamingParser) Done

func (sp *StreamingParser) Done() <-chan struct{}

Done returns the done channel

func (*StreamingParser) Errors

func (sp *StreamingParser) Errors() <-chan error

Errors returns the errors channel

func (*StreamingParser) Events

func (sp *StreamingParser) Events() <-chan data.LogEvent

Events returns the events channel for consumption

func (*StreamingParser) Start

func (sp *StreamingParser) Start()

Start begins streaming parsing

func (*StreamingParser) Stats

func (sp *StreamingParser) Stats() (events int64, files int64)

Stats returns current parsing statistics

Jump to

Keyboard shortcuts

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