public class DcpClientMetrics extends Object
| Constructor and Description |
|---|
DcpClientMetrics(MetricsContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
DcpChannelMetrics |
channelMetrics(HostAndPort address) |
void |
incrementAddChannel() |
void |
incrementReconfigure() |
void |
incrementRemoveChannel() |
void |
registerConnectionStatusGauges(Collection<DcpChannel> channels)
Updates the "connection status" gauge for all channels.
|
LongAdder |
scheduledPollingTasks() |
public DcpClientMetrics(MetricsContext ctx)
public void incrementReconfigure()
public void incrementAddChannel()
public void incrementRemoveChannel()
public LongAdder scheduledPollingTasks()
public DcpChannelMetrics channelMetrics(HostAndPort address)
public void registerConnectionStatusGauges(Collection<DcpChannel> channels)
Micrometer gauges are finicky about only being registered once, which could cause problems if we were to naively register the gauge as part of the channel metrics, since it's possible for a channel to come and go.
A MultiGauge does not suffer from this limitation, so let's use that instead, and overwrite the previous measurements each time there's a connection state change. It's also an easy way to clean up gauges for channels that are no longer part of the cluster.
Copyright © 2021 Couchbase, Inc.. All rights reserved.