public class HealthTrackerRegistryImpl extends Object implements HealthTrackerRegistry
HealthTracker health trackers created per ProjectSubscriptionName.| Constructor and Description |
|---|
HealthTrackerRegistryImpl(String projectId,
MetricServiceClient metricServiceClient,
Integer lagThreshold,
Integer backlogThreshold,
Integer lookUpInterval,
com.google.api.gax.core.ExecutorProvider executorProvider) |
HealthTrackerRegistryImpl(String projectId,
MetricServiceClient metricServiceClient,
Integer lagThreshold,
Integer backlogThreshold,
Integer lookUpInterval,
com.google.api.gax.core.ExecutorProvider executorProvider,
ConcurrentMap<com.google.pubsub.v1.ProjectSubscriptionName,HealthTracker> healthTrackers) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(Subscriber subscriber)
Attaches a listener to a Pub/Sub subscriber provided a
HealthTracker is registered for
that subscription. |
Collection<HealthTracker> |
healthTrackers()
Retrieve all the health trackers registered.
|
boolean |
isTracked(com.google.pubsub.v1.ProjectSubscriptionName projectSubscriptionName)
Check if a
ProjectSubscriptionName has a HealthTracker registered. |
void |
processedMessage(com.google.pubsub.v1.ProjectSubscriptionName subscription)
Propagate that a message has been processed to the corresponding
HealthTracker if
registered. |
HealthTracker |
registerTracker(com.google.pubsub.v1.ProjectSubscriptionName projectSubscriptionName)
Create a tracker for given
ProjectSubscriptionName and add tracker to registry. |
HealthTracker |
registerTracker(String subscriptionName)
Create a tracker for given subscription name and add tracker to registry.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwrappublic HealthTrackerRegistryImpl(String projectId, MetricServiceClient metricServiceClient, Integer lagThreshold, Integer backlogThreshold, Integer lookUpInterval, com.google.api.gax.core.ExecutorProvider executorProvider)
public HealthTrackerRegistryImpl(String projectId, MetricServiceClient metricServiceClient, Integer lagThreshold, Integer backlogThreshold, Integer lookUpInterval, com.google.api.gax.core.ExecutorProvider executorProvider, ConcurrentMap<com.google.pubsub.v1.ProjectSubscriptionName,HealthTracker> healthTrackers)
public HealthTracker registerTracker(String subscriptionName)
HealthTrackerRegistryregisterTracker in interface HealthTrackerRegistrysubscriptionName - the subscription name to create a ProjectSubscriptionName using
the default project-Id.HealthTracker that has been created and registered.public HealthTracker registerTracker(com.google.pubsub.v1.ProjectSubscriptionName projectSubscriptionName)
HealthTrackerRegistryProjectSubscriptionName and add tracker to registry.registerTracker in interface HealthTrackerRegistryprojectSubscriptionName - the full subscription nameHealthTracker that has been created and registered.public boolean isTracked(com.google.pubsub.v1.ProjectSubscriptionName projectSubscriptionName)
HealthTrackerRegistryProjectSubscriptionName has a HealthTracker registered.isTracked in interface HealthTrackerRegistryprojectSubscriptionName - the full subscription name.HealthTracker is registered.public void processedMessage(com.google.pubsub.v1.ProjectSubscriptionName subscription)
HealthTrackerRegistryHealthTracker if
registered.processedMessage in interface HealthTrackerRegistrysubscription - the full ProjectSubscriptionName name to monitor.public void addListener(Subscriber subscriber)
HealthTrackerRegistryHealthTracker is registered for
that subscription. On subscriber termination, the corresponding HealthTracker shall be
removed from the registry.addListener in interface HealthTrackerRegistrysubscriber - the subscriber to attach a listener.public Collection<HealthTracker> healthTrackers()
HealthTrackerRegistryhealthTrackers in interface HealthTrackerRegistryCopyright © 2022. All rights reserved.