@ThreadSafe public class InfluxDbWriter extends OutputWriterAdapter
OutputWriter for
InfluxDB.| Modifier and Type | Field and Description |
|---|---|
static String |
TAG_HOSTNAME |
| Constructor and Description |
|---|
InfluxDbWriter(org.influxdb.InfluxDB influxDB,
String database,
org.influxdb.InfluxDB.ConsistencyLevel writeConsistency,
String retentionPolicy,
com.google.common.collect.ImmutableMap<String,String> tags,
com.google.common.collect.ImmutableSet<ResultAttribute> resultAttributesToWriteAsTags,
boolean createDatabase) |
| Modifier and Type | Method and Description |
|---|---|
void |
doWrite(Server server,
Query query,
Iterable<Result> results)
Each
Result is written as a Point to InfluxDB |
close, getSettings, start, validateSetuppublic static final String TAG_HOSTNAME
public InfluxDbWriter(@Nonnull org.influxdb.InfluxDB influxDB, @Nonnull String database, @Nonnull org.influxdb.InfluxDB.ConsistencyLevel writeConsistency, @Nonnull String retentionPolicy, @Nonnull com.google.common.collect.ImmutableMap<String,String> tags, @Nonnull com.google.common.collect.ImmutableSet<ResultAttribute> resultAttributesToWriteAsTags, boolean createDatabase)
public void doWrite(Server server, Query query, Iterable<Result> results) throws 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
ExceptionCopyright © 2010-2016 JmxTrans team. All Rights Reserved.