Stop recording Lettuce latency metrics.
This commit is contained in:
parent
d86d565b3f
commit
0aafe38496
|
@ -80,7 +80,6 @@ import org.whispersystems.textsecuregcm.metrics.FreeMemoryGauge;
|
|||
import org.whispersystems.textsecuregcm.metrics.GarbageCollectionGauges;
|
||||
import org.whispersystems.textsecuregcm.metrics.MaxFileDescriptorGauge;
|
||||
import org.whispersystems.textsecuregcm.metrics.MetricsApplicationEventListener;
|
||||
import org.whispersystems.textsecuregcm.metrics.MicrometerLettuceCommandLatencyRecorder;
|
||||
import org.whispersystems.textsecuregcm.metrics.NetworkReceivedGauge;
|
||||
import org.whispersystems.textsecuregcm.metrics.NetworkSentGauge;
|
||||
import org.whispersystems.textsecuregcm.metrics.OperatingSystemMemoryGauge;
|
||||
|
@ -279,7 +278,7 @@ public class WhisperServerService extends Application<WhisperServerConfiguration
|
|||
ReplicatedJedisPool directoryClient = directoryClientFactory.getRedisClientPool();
|
||||
ReplicatedJedisPool pushSchedulerClient = pushSchedulerClientFactory.getRedisClientPool();
|
||||
|
||||
ClientResources redisClusterClientResources = ClientResources.builder().commandLatencyRecorder(new MicrometerLettuceCommandLatencyRecorder()).build();
|
||||
ClientResources redisClusterClientResources = ClientResources.builder().build();
|
||||
ConnectionEventLogger.logConnectionEvents(redisClusterClientResources);
|
||||
|
||||
FaultTolerantRedisCluster cacheCluster = new FaultTolerantRedisCluster("main_cache_cluster", config.getCacheClusterConfiguration(), redisClusterClientResources);
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
/*
|
||||
* Copyright 2013-2020 Signal Messenger, LLC
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package org.whispersystems.textsecuregcm.metrics;
|
||||
|
||||
import io.lettuce.core.metrics.CommandLatencyRecorder;
|
||||
import io.lettuce.core.protocol.ProtocolKeyword;
|
||||
import io.micrometer.core.instrument.Metrics;
|
||||
import io.micrometer.core.instrument.Tag;
|
||||
|
||||
import java.net.SocketAddress;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.codahale.metrics.MetricRegistry.name;
|
||||
|
||||
public class MicrometerLettuceCommandLatencyRecorder implements CommandLatencyRecorder {
|
||||
|
||||
private static final String FIRST_RESPONSE_TIMER_NAME = name(MicrometerLettuceCommandLatencyRecorder.class, "firstResponse");
|
||||
private static final String COMPLETION_TIMER_NAME = name(MicrometerLettuceCommandLatencyRecorder.class, "completion");
|
||||
|
||||
@Override
|
||||
public void recordCommandLatency(final SocketAddress local, final SocketAddress remote, final ProtocolKeyword commandType, final long firstResponseLatency, final long completionLatency) {
|
||||
final List<Tag> tags = List.of(Tag.of("redisHost", remote.toString()), Tag.of("command", commandType.name()));
|
||||
|
||||
Metrics.timer(FIRST_RESPONSE_TIMER_NAME, tags).record(firstResponseLatency, TimeUnit.NANOSECONDS);
|
||||
Metrics.timer(COMPLETION_TIMER_NAME, tags).record(completionLatency, TimeUnit.NANOSECONDS);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue