Class HealthTrackerImpl

All Implemented Interfaces:

public class HealthTrackerImpl extends Object implements HealthTracker
Health tracker for a Pub/Sub subscription. The tracker will monitor messages being processed and the subscription's message backlog. If backlog message size exceeds the message backlog threshold, the tracker will return the number of messages over the threshold.
  • Constructor Details

    • HealthTrackerImpl

      public HealthTrackerImpl( projectSubscriptionName, metricServiceClient, Integer lagThreshold, Integer backlogThreshold, Integer lookUpInterval)
  • Method Details

    • processedMessage

      public void processedMessage()
      Description copied from interface: HealthTracker
      Record that a message has been processed.
      Specified by:
      processedMessage in interface HealthTracker
    • subscription

      public subscription()
      Description copied from interface: HealthTracker
      Accessor for the Subscription being monitored by the tracker.
      Specified by:
      subscription in interface HealthTracker
      the project subscription name
    • messagesOverThreshold

      public long messagesOverThreshold()
      Description copied from interface: HealthTracker
      If messages have been processed recently returns zero. If no message have been recently processed the tracker will retrieve the number of messages in the subscription backlog. If the backlogs exceeds the threshold the messages over the threshold shall be returned.
      Specified by:
      messagesOverThreshold in interface HealthTracker
      the messages over the threshold