measure

package
v1.5.111 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecuteOptionFunc

type ExecuteOptionFunc func(*ExecutorTimeMeasurement)

ExecuteOptionFunc is a function to set executor options

func WithShowDuration

func WithShowDuration() ExecuteOptionFunc

WithShowDuration enables to show command duration

func WithWrite

func WithWrite(w io.Writer) ExecuteOptionFunc

WithWrite set the writer to be used by DefaultExecutor

type ExecutorTimeMeasurement

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

ExecutorTimeMeasurement is a middleware that measure the execution time of a command

func NewExecutorTimeMeasurement

func NewExecutorTimeMeasurement(executor execute.Executor, options ...ExecuteOptionFunc) *ExecutorTimeMeasurement

NewExecutorTimeMeasurement returns a new ExecutorTimeMeasurement

func (*ExecutorTimeMeasurement) Duration

func (e *ExecutorTimeMeasurement) Duration() time.Duration

Duration returns the duration of the command

func (*ExecutorTimeMeasurement) Execute

Execute takes a command and args and runs it, streaming output to stdout

Jump to

Keyboard shortcuts

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