Class UnitOfWork

java.lang.Object
com.kingsrook.qqq.backend.core.instrumentation.UnitOfWork

public final class UnitOfWork extends Object
One unit of work on one thread (an HTTP request, a scheduled job, or a process run outside both), opened and closed by core through UnitsOfWork. Statements run while it is open are attributed to it. The name may be refined while the unit is open (for example an HTTP request learns its route template only after routing), so listeners that need the final name read it in onUnitOfWorkEnd.
  • Method Details

    • getId

      public long getId()
      JVM-unique id of this unit.
    • getKind

      public UnitOfWorkKind getKind()
      What started this unit.
    • getName

      public String getName()
      The unit's name: route template, job or process name.
    • setName

      public void setName(String name)
      Refine the name (e.g. once a request's route template is known).
    • getStartNanos

      public long getStartNanos()
      System.nanoTime() when the unit began.
    • toString

      public String toString()
      Kind and name, for logs.
      Overrides:
      toString in class Object