timer

package
v0.32.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2021 License: GPL-2.0, GPL-3.0 Imports: 4 Imported by: 0

README

timer - Timer Middleware

Arguments

Enable time recording by setting the record argument to true.

- some_pipeline:
    timer:
      record: bool,

The execution time of the pipe will be logged at debug level. You might need to use the -v debug argument to ensure the log entries are actually visible.

TODO:
  • use dedicated logging channel to merge timing information into actual output

Documentation

Overview

Package timer provides a middleware that records execution time

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TimeProvider

type TimeProvider interface {
	Now() time.Time
	Since(time time.Time) time.Duration
}

Execution Time Recorder

type TimerMiddleware

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

func NewTimerMiddleware

func NewTimerMiddleware() TimerMiddleware

func NewTimerMiddlewareWithProvider

func NewTimerMiddlewareWithProvider(timeProvider TimeProvider) TimerMiddleware

func (TimerMiddleware) Apply

func (timerMiddleware TimerMiddleware) Apply(
	run *pipeline.Run,
	next func(*pipeline.Run),
	_ *middleware.ExecutionContext,
)

func (TimerMiddleware) String

func (timerMiddleware TimerMiddleware) String() string

Jump to

Keyboard shortcuts

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