Search in sources :

Example 26 with InfluxDB

use of org.influxdb.InfluxDB in project spring-boot by spring-projects.

the class InfluxDbAutoConfiguration method influxDb.

@Bean
@ConditionalOnMissingBean
@ConditionalOnProperty("spring.influx.url")
public InfluxDB influxDb(InfluxDbProperties properties, ObjectProvider<InfluxDbOkHttpClientBuilderProvider> builder, ObjectProvider<InfluxDbCustomizer> customizers) {
    InfluxDB influxDb = new InfluxDBImpl(properties.getUrl(), properties.getUser(), properties.getPassword(), determineBuilder(builder.getIfAvailable()));
    customizers.orderedStream().forEach((customizer) -> customizer.customize(influxDb));
    return influxDb;
}
Also used : InfluxDB(org.influxdb.InfluxDB) InfluxDBImpl(org.influxdb.impl.InfluxDBImpl) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean) ConditionalOnProperty(org.springframework.boot.autoconfigure.condition.ConditionalOnProperty)

Aggregations

InfluxDB (org.influxdb.InfluxDB)26 Test (org.junit.Test)7 Query (org.influxdb.dto.Query)5 BatchPoints (org.influxdb.dto.BatchPoints)4 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 Builder (org.influxdb.dto.Point.Builder)3 Test (org.junit.jupiter.api.Test)3 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)3 JsonObject (com.google.gson.JsonObject)2 List (java.util.List)2 Map (java.util.Map)2 TreeMap (java.util.TreeMap)2 PipelineResult (org.apache.beam.sdk.PipelineResult)2 QueryResult (org.influxdb.dto.QueryResult)2 Series (org.influxdb.dto.QueryResult.Series)2 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)2 Health (org.springframework.boot.actuate.health.Health)2 Bean (org.springframework.context.annotation.Bean)2 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)1