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: ? 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.

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