Class TaskReactorTelemetry


  • public class TaskReactorTelemetry
    extends Object
    Telemetry utility for Task Reactor.
    • Constructor Detail

      • TaskReactorTelemetry

        public TaskReactorTelemetry()
    • Method Detail

      • setTaskReactorInstanceNameSpanAttribute

        public static void setTaskReactorInstanceNameSpanAttribute​(Identifier value)
        Sets the value of the Task Reactor instance name span attribute.
        Parameters:
        value - attribute value
      • setWorkerIdSpanAttribute

        public static void setWorkerIdSpanAttribute​(WorkerId workerId)
        Sets the value of the worker id span attribute.
        Parameters:
        workerId - attribute value
      • addWorkerIdleTimeEvent

        public static void addWorkerIdleTimeEvent​(Instant startTime,
                                                  Instant endTime)
        Adds a new event for the worker idle time.
        Parameters:
        startTime - idle start time
        endTime - idle end time
      • addWorkerWorkingTimeEvent

        public static void addWorkerWorkingTimeEvent​(Instant startTime,
                                                     Instant endTime)
        Adds a new event for the worker working time.
        Parameters:
        startTime - working start time
        endTime - working end time
      • addWorkItemWaitingInQueueTimeEvent

        public static void addWorkItemWaitingInQueueTimeEvent​(Timestamp startTime,
                                                              Instant endTime)
        Adds a new event for the time of work item waiting in a dispatcher queue.
        Parameters:
        startTime - time when a work item was inserted to a dispatcher queue
        endTime - time when a work item was removed from a dispatcher queue and inserted to worker queue
      • addWorkItemsNumberInQueueEvent

        public static void addWorkItemsNumberInQueueEvent​(long number,
                                                          Identifier instanceName)
        Adds a new event for the number of work items present in a dispatcher queue.
        Parameters:
        number - number of work items
        instanceName - Task Reactor instance name
      • addWorkerStatusEvent

        public static void addWorkerStatusEvent​(Map<String,​Integer> statuses)
        Adds a new event which contains the number of workers in each worker status. The event contains also an additional field which presents the total number of workers.
        Parameters:
        statuses - number of workers for each status which should be logged