builder().withInterval(1, TimeUnit.SECONDS).withMinRecordedValues(100).build(); tracker.onRegister(cluster0);
builder().withInterval(1, TimeUnit.SECONDS).withMinRecordedValues(100).build(); tracker.onRegister(cluster0);
public CassandraService(CassandraModule.Config cassandraConfig) { PerHostPercentileTracker tracker = PerHostPercentileTracker.builderWithHighestTrackableLatencyMillis(SocketOptions.DEFAULT_READ_TIMEOUT_MILLIS + 500).build();
public static QueryLoggerConfiguration from(Configuration configuration) { QueryLoggerConfiguration.Builder builder = QueryLoggerConfiguration.builder(); Optional<Long> constantThreshold = getOptionalIntegerFromConf(configuration, "cassandra.query.logger.constant.threshold") .map(Long::valueOf); constantThreshold.ifPresent(builder::withConstantThreshold); getOptionalIntegerFromConf(configuration, "cassandra.query.logger.max.logged.parameters") .ifPresent(builder::withMaxLoggedParameters); getOptionalIntegerFromConf(configuration, "cassandra.query.logger.max.query.string.length") .ifPresent(builder::withMaxQueryStringLength); getOptionalIntegerFromConf(configuration, "cassandra.query.logger.max.parameter.value.length") .ifPresent(builder::withMaxParameterValueLength); Optional<Double> percentileLatencyConf = getOptionalDoubleFromConf(configuration, "cassandra.query.slow.query.latency.threshold.percentile"); if (!percentileLatencyConf.isPresent() && !constantThreshold.isPresent()) { percentileLatencyConf = Optional.of(QueryLogger.DEFAULT_SLOW_QUERY_THRESHOLD_PERCENTILE); } percentileLatencyConf.ifPresent(slowQueryLatencyThresholdPercentile -> { PerHostPercentileTracker tracker = PerHostPercentileTracker .builder(CASSANDRA_HIGHEST_TRACKABLE_LATENCY_MILLIS) .build(); builder.withDynamicThreshold(tracker, slowQueryLatencyThresholdPercentile); }); return builder.build(); }
public static QueryLoggerConfiguration from(Configuration configuration) { QueryLoggerConfiguration.Builder builder = QueryLoggerConfiguration.builder(); Optional<Long> constantThreshold = getOptionalIntegerFromConf(configuration, "cassandra.query.logger.constant.threshold") .map(Long::valueOf); constantThreshold.ifPresent(builder::withConstantThreshold); getOptionalIntegerFromConf(configuration, "cassandra.query.logger.max.logged.parameters") .ifPresent(builder::withMaxLoggedParameters); getOptionalIntegerFromConf(configuration, "cassandra.query.logger.max.query.string.length") .ifPresent(builder::withMaxQueryStringLength); getOptionalIntegerFromConf(configuration, "cassandra.query.logger.max.parameter.value.length") .ifPresent(builder::withMaxParameterValueLength); Optional<Double> percentileLatencyConf = getOptionalDoubleFromConf(configuration, "cassandra.query.slow.query.latency.threshold.percentile"); if (!percentileLatencyConf.isPresent() && !constantThreshold.isPresent()) { percentileLatencyConf = Optional.of(QueryLogger.DEFAULT_SLOW_QUERY_THRESHOLD_PERCENTILE); } percentileLatencyConf.ifPresent(slowQueryLatencyThresholdPercentile -> { PerHostPercentileTracker tracker = PerHostPercentileTracker .builder(CASSANDRA_HIGHEST_TRACKABLE_LATENCY_MILLIS) .build(); builder.withDynamicThreshold(tracker, slowQueryLatencyThresholdPercentile); }); return builder.build(); }
/** * Returns a builder to create a new instance. * * @param highestTrackableLatencyMillis the highest expected latency. If a higher value is reported, it will be * ignored and a warning will be logged. A good rule of thumb is to set it * slightly higher than {@link SocketOptions#getReadTimeoutMillis()}. * @return the builder. */ public static Builder builder(long highestTrackableLatencyMillis) { return new Builder(highestTrackableLatencyMillis); }
/** * Returns a builder to create a new instance. * * @param highestTrackableLatencyMillis the highest expected latency. If a higher value is reported, it will be * ignored and a warning will be logged. A good rule of thumb is to set it * slightly higher than {@link SocketOptions#getReadTimeoutMillis()}. * @return the builder. */ public static Builder builder(long highestTrackableLatencyMillis) { return new Builder(highestTrackableLatencyMillis); }
/** * Returns a builder to create a new instance. * * @param highestTrackableLatencyMillis the highest expected latency. If a higher value is reported, it will be * ignored and a warning will be logged. A good rule of thumb is to set it * slightly higher than {@link SocketOptions#getReadTimeoutMillis()}. * @return the builder. */ public static Builder builder(long highestTrackableLatencyMillis) { return new Builder(highestTrackableLatencyMillis); }
/** * Returns a builder to create a new instance. * * @param highestTrackableLatencyMillis the highest expected latency. If a higher value is * reported, it will be ignored and a warning will be logged. A good rule of thumb is to set * it slightly higher than {@link SocketOptions#getReadTimeoutMillis()}. * @return the builder. */ public static Builder builder(long highestTrackableLatencyMillis) { return new Builder(highestTrackableLatencyMillis); }