bamzi / jobrunner

Framework for performing work asynchronously, outside of the request flow
MIT License
1.04k stars 99 forks source link

Add info how long last run took on a status page. #1

Closed alehano closed 8 years ago

alehano commented 8 years ago

Feature request. It would be very useful to know how long a job was executed.

bamzi commented 8 years ago

@alehano This feature was originally apart of the package but got moved out because process duration should be tracked on the job's app endpoint function and not on the package level. We moved it out so that performance & duration to be tracked apart of app level log.

I'll look into bringing it back without breaking backwards compatibility.

bamzi commented 8 years ago

@alehano It's added as per your request.

Side note: This will track how long the last job took to finish. So if you add time.Sleep or open-ended functions, like infinite loops, or keep alive channels or goroutines then expect the latency to be much higher than the actual truth.

It's best practice to keep time logging within the end function and log it to an external monitoring/metrics system for better accuracy.

alehano commented 8 years ago

Thank you!