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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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