Search in sources :

Example 1 with Builder

use of com.wavefront.sdk.common.clients.WavefrontClient.Builder in project spring-boot by spring-projects.

the class WavefrontMetricsExportAutoConfiguration method createWavefrontSender.

private WavefrontSender createWavefrontSender(WavefrontConfig wavefrontConfig) {
    Builder builder = WavefrontMeterRegistry.getDefaultSenderBuilder(wavefrontConfig);
    PropertyMapper mapper = PropertyMapper.get().alwaysApplyingWhenNonNull();
    Sender sender = this.properties.getSender();
    mapper.from(sender.getMaxQueueSize()).to(builder::maxQueueSize);
    mapper.from(sender.getFlushInterval()).asInt(Duration::getSeconds).to(builder::flushIntervalSeconds);
    mapper.from(sender.getMessageSize()).asInt(DataSize::toBytes).to(builder::messageSizeBytes);
    return builder.build();
}
Also used : WavefrontSender(com.wavefront.sdk.common.WavefrontSender) Sender(org.springframework.boot.actuate.autoconfigure.metrics.export.wavefront.WavefrontProperties.Sender) Builder(com.wavefront.sdk.common.clients.WavefrontClient.Builder) PropertyMapper(org.springframework.boot.context.properties.PropertyMapper)

Aggregations

WavefrontSender (com.wavefront.sdk.common.WavefrontSender)1 Builder (com.wavefront.sdk.common.clients.WavefrontClient.Builder)1 Sender (org.springframework.boot.actuate.autoconfigure.metrics.export.wavefront.WavefrontProperties.Sender)1 PropertyMapper (org.springframework.boot.context.properties.PropertyMapper)1