--
You received this message because you are subscribed to the Google Groups "lettuce-redis-client-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lettuce-redis-clien...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lettuce-redis-client-users/464ad47c-81c1-43b2-8809-584723bb2466%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to lettuce-redis-client-users+unsub...@googlegroups.com.
Ir was amazing how much memory lettuce metrics took. Also, we had this piece of code which consumed those metrics:
public static void collectRedisMetrics(IStatsEventCollector statsEventCollector, ClientResources clientResources, String storage) {
EventBus eventBus = clientResources.eventBus();
eventBus.get()
.filter(redisEvent ->
redisEvent instanceof CommandLatencyEvent)
.cast(CommandLatencyEvent.class)
.subscribe(e -> {
Set<Map.Entry<CommandLatencyId, CommandMetrics>> commandLatencies = e.getLatencies().entrySet();
for (Map.Entry<CommandLatencyId, CommandMetrics> commandLatency : commandLatencies) {
String keyword = commandLatency.getKey().commandType().name();
CommandMetrics commandMetric = commandLatency.getValue();
long count = commandMetric.getCount();
CommandMetrics.CommandLatency completion = commandMetric.getCompletion();
Map<Double, Long> percentiles = completion.getPercentiles();
statsEventCollector.durationEvent("RedisLatency", Map.of("storage", storage, "command", keyword, "measure", "count"), count);
statsEventCollector.durationEvent("RedisLatency", Map.of("storage", storage, "command", keyword, "measure", "min"), completion.getMin());
statsEventCollector.durationEvent("RedisLatency", Map.of("storage", storage, "command", keyword, "measure", "90"), percentiles.get(90d));
statsEventCollector.durationEvent("RedisLatency", Map.of("storage", storage, "command", keyword, "measure", "95"), percentiles.get(95d));
statsEventCollector.durationEvent("RedisLatency", Map.of("storage", storage, "command", keyword, "measure", "99"), percentiles.get(99d));
statsEventCollector.durationEvent("RedisLatency", Map.of("storage", storage, "command", keyword, "measure", "max"), completion.getMax());
}
});
}
@Provides
ClientResources provideClientResources() {
return DefaultClientResources.builder()
.commandLatencyCollectorOptions(DefaultCommandLatencyCollectorOptions.disabled())
.build();
}
Sharing some of my findings.I did run profiler and took some memory snapshots.
<lettuce-1.png>
<Screenshot 2019-07-05 at 11.15.01.png>
And memory:<Screenshot 2019-07-05 at 11.16.36.png>
To unsubscribe from this group and stop receiving emails from it, send an email to lettuce-redis-clien...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lettuce-redis-client-users/96e4499e-ba7c-4427-802d-d327988289b6%40googlegroups.com.