emetric

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package emetric provides primitives for searching and processing data in Metric files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleAll

func HandleAll(le *metrics.ZMetricMsg) bool

HandleAll runs for all Logs selected by LogWatch

func HandleFirst

func HandleFirst(le *metrics.ZMetricMsg) bool

HandleFirst runs once and interrupts the workflow of LogWatch

func MetricChecker

func MetricChecker(loader loaders.Loader, devUUID uuid.UUID, q map[string]string, handler HandlerFunc, mode MetricCheckerMode, timeout time.Duration) (err error)

MetricChecker check metrics by pattern from existence files with HandlerFunc with timeout for observe new files

func MetricItemFind

func MetricItemFind(mm *metrics.ZMetricMsg, query map[string]string) bool

MetricItemFind find ZMetricMsg records by reqexps in 'query' corresponded to ZMetricMsg structure.

func MetricItemPrint

func MetricItemPrint(mm *metrics.ZMetricMsg, query []string) *types.PrintResult

MetricItemPrint find ZMetricMsg records by path in 'query'

func MetricLast

func MetricLast(loader loaders.Loader, query map[string]string, handler HandlerFunc) error

MetricLast function process Metric files in the 'filepath' directory according to the 'query' reqexps and return last founded item

func MetricPrn

func MetricPrn(le *metrics.ZMetricMsg)

MetricPrn print Metric data

func MetricWatch

func MetricWatch(loader loaders.Loader, query map[string]string, handler HandlerFunc, timeoutSeconds time.Duration) error

MetricWatch monitors the change of Metric files in the 'filepath' directory according to the 'query' reqexps and processing using the 'handler' function.

func ParseMetricsBundle

func ParseMetricsBundle(data []byte) (logBundle *metrics.ZMetricMsg, err error)

ParseMetricsBundle unmarshal LogBundle

Types

type HandlerFunc

type HandlerFunc func(msg *metrics.ZMetricMsg) bool

HandlerFunc must process ZMetricMsg and return true to exit or false to continue

type MetricCheckerMode

type MetricCheckerMode int

MetricCheckerMode is MetricExist, MetricNew and MetricAny

const (
	MetricExist MetricCheckerMode = -3 //MetricExist just look to existing files
	MetricNew   MetricCheckerMode = -2 //MetricNew wait for new files
	MetricAny   MetricCheckerMode = -1 //MetricAny use both mechanisms
)

MetricChecker modes MetricExist, MetricNew and MetricAny.

func MetricTail

func MetricTail(count uint) MetricCheckerMode

MetricTail returns MetricCheckerMode for process only defined count of last messages

Jump to

Keyboard shortcuts

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