plugins

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//StdOutLog simple stdout debug log
	StdOutLog = func() log.Logger {
		l := log.Default()
		l.SetLevel(log.LevelDebug)
		l.SetOutput(StdOutWriter)
		return l
	}()
)
View Source
var StdOutMetric = NewMetric(StdOutWriter)

StdOutMetric simple stdout metrig writer

View Source
var StdOutWriter = &stdout{Writer: os.Stdout}

StdOutWriter simple stdout writer

Functions

This section is empty.

Types

type MetricExecutor

type MetricExecutor interface {
	ExecutionTime(name string, call func())
}

MetricExecutor interface

var (
	DevNullLog    log.Logger     = &devNullLogger{}
	DevNullMetric MetricExecutor = new(devNullMetric)
)

func NewMetric

func NewMetric(m MetricWriter) MetricExecutor

NewMetric init new metric

type MetricWriter

type MetricWriter interface {
	Metric(name string, time time.Duration)
}

MetricWriter interface

Jump to

Keyboard shortcuts

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