@ThreadSafe public class InfluxDbWriter extends OutputWriterAdapter
OutputWriter for
InfluxDB.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
JMX_PORT_KEY |
static java.lang.String |
TAG_HOSTNAME |
| Constructor and Description |
|---|
InfluxDbWriter(org.influxdb.InfluxDB influxDB,
java.lang.String database,
org.influxdb.InfluxDB.ConsistencyLevel writeConsistency,
java.lang.String retentionPolicy,
com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> tags,
com.google.common.collect.ImmutableSet<ResultAttribute> resultAttributesToWriteAsTags,
com.google.common.collect.ImmutableList<java.lang.String> typeNames,
boolean createDatabase,
boolean reportJmxPortAsTag,
boolean typeNamesAsTags,
boolean allowStringValues) |
| Modifier and Type | Method and Description |
|---|---|
void |
doWrite(Server server,
Query query,
java.lang.Iterable<Result> results)
Each
Result is written as a Point to InfluxDB
The measurement for the Point is to Result.getKeyAlias()
The retention policy for the measurement is set to "default" unless
overridden in settings:
The write consistency level defaults to "ALL" unless overridden in
settings:
ALL = Write succeeds only if write reached all cluster members. |
close, getSettings, start, validateSetuppublic static final java.lang.String TAG_HOSTNAME
public static final java.lang.String JMX_PORT_KEY
public InfluxDbWriter(@Nonnull
org.influxdb.InfluxDB influxDB,
@Nonnull
java.lang.String database,
@Nonnull
org.influxdb.InfluxDB.ConsistencyLevel writeConsistency,
@Nonnull
java.lang.String retentionPolicy,
@Nonnull
com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> tags,
@Nonnull
com.google.common.collect.ImmutableSet<ResultAttribute> resultAttributesToWriteAsTags,
@Nonnull
com.google.common.collect.ImmutableList<java.lang.String> typeNames,
boolean createDatabase,
boolean reportJmxPortAsTag,
boolean typeNamesAsTags,
boolean allowStringValues)
public void doWrite(Server server, Query query, java.lang.Iterable<Result> results) throws java.lang.Exception
Each Result is written as a Point to InfluxDB
The measurement for the Point is to Result.getKeyAlias()
The retention policy for the measurement is set to "default" unless overridden in settings:
The write consistency level defaults to "ALL" unless overridden in settings:
The time key for the Point is set to Result.getEpoch()
All Result#getValues() are written as fields to the Point
The following properties from Result are written as tags to the
Point unless overriden in settings:
Server.getHost() is set as a tag on every Point
Server.getPort() is written as a field, unless reportJmxPortAsTag is set to true
java.lang.ExceptionCopyright © 2010-2021 JmxTrans team. All Rights Reserved.