timer

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggerConfig

func LoggerConfig(prefix string)

func MakeRequestTimeTracker

func MakeRequestTimeTracker(
	handler func(rw http.ResponseWriter, req *http.Request) error,
	saver func(t time.Duration),
	saveOnError bool,
) func(rw http.ResponseWriter, req *http.Request) error

MakeRequestTimeTracker sticks functions to the request that is called while the request processes. Functions put some time points for calculating backend time and full-trip time.

func SaveTimeDataBackend

func SaveTimeDataBackend(backendTime time.Duration)

SaveTimeDataBackend is used for saving backend to DB. Uses pointer for using in functions with `defer` prefix.

func SaveTimeFullTrip

func SaveTimeFullTrip(fullTime time.Duration)

func SaveTimerDataGotFromCache

func SaveTimerDataGotFromCache(cacheTime time.Duration)

SaveTimerDataGotFromCache uses a pointer at time for saving it to some DB if the response is got from cache. Pointer is used for saving calling in `defer` functions.

Types

This section is empty.

Jump to

Keyboard shortcuts

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