All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.dropwizard.redis.metrics.DropwizardCommandLatencyRecorderFactory Maven / Gradle / Ivy

package io.dropwizard.redis.metrics;

import com.codahale.metrics.MetricRegistry;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.lettuce.core.metrics.CommandLatencyRecorder;
import io.lettuce.core.metrics.DefaultCommandLatencyCollectorOptions;

@JsonTypeName("dropwizard")
public class DropwizardCommandLatencyRecorderFactory implements CommandLatencyRecorderFactory {

    @JsonProperty
    private boolean enabled = true;

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    @Override
    public CommandLatencyRecorder build(MetricRegistry metricRegistry) {
        return new DropwizardCommandLatencyRecorder(metricRegistry, enabled);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy