public class HealthTrackerRegistryImpl extends Object implements HealthTrackerRegistry
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, wait
wrap
public 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)
HealthTrackerRegistry
registerTracker
in interface HealthTrackerRegistry
subscriptionName
- 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)
HealthTrackerRegistry
ProjectSubscriptionName
and add tracker to registry.registerTracker
in interface HealthTrackerRegistry
projectSubscriptionName
- the full subscription nameHealthTracker
that has been created and registered.public boolean isTracked(com.google.pubsub.v1.ProjectSubscriptionName projectSubscriptionName)
HealthTrackerRegistry
ProjectSubscriptionName
has a HealthTracker
registered.isTracked
in interface HealthTrackerRegistry
projectSubscriptionName
- the full subscription name.HealthTracker
is registered.public void processedMessage(com.google.pubsub.v1.ProjectSubscriptionName subscription)
HealthTrackerRegistry
HealthTracker
if registered.processedMessage
in interface HealthTrackerRegistry
subscription
- the full ProjectSubscriptionName
name to monitor.public void addListener(Subscriber subscriber)
HealthTrackerRegistry
HealthTracker
is registered for that subscription.
On subscriber termination, the corresponding HealthTracker
shall be removed from the registry.addListener
in interface HealthTrackerRegistry
subscriber
- the subscriber to attach a listener.public Collection<HealthTracker> healthTrackers()
HealthTrackerRegistry
healthTrackers
in interface HealthTrackerRegistry
Copyright © 2021. All rights reserved.