Class ProfilerMiddleware
- java.lang.Object
-
- com.github.sonus21.rqueue.core.middleware.ProfilerMiddleware
-
- All Implemented Interfaces:
Middleware
public class ProfilerMiddleware extends java.lang.Object implements Middleware
A profile middleware that measures the execution time of a job, a more sophisticated profiler middleware can report latency to New Relic, Datadog, or use Micrometer to report latency or any other data.
-
-
Constructor Summary
Constructors Constructor Description ProfilerMiddleware()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handle(Job job, java.util.concurrent.Callable<java.lang.Void> next)
Middleware handles that would be calledprotected void
report(Job job, java.time.Duration executionTime)
Report execution of the said job
-
-
-
Method Detail
-
report
protected void report(Job job, java.time.Duration executionTime)
Report execution of the said job- Parameters:
job
- the running jobexecutionTime
- execution time
-
handle
public void handle(Job job, java.util.concurrent.Callable<java.lang.Void> next) throws java.lang.Exception
Description copied from interface:Middleware
Middleware handles that would be called- Specified by:
handle
in interfaceMiddleware
- Parameters:
job
- job objectnext
- next middleware in chain- Throws:
java.lang.Exception
- any exception
-
-