| | |
| | | point.addTag("point", pointNo); |
| | | point.addField("value", Double.parseDouble(dataValue)); |
| | | point.time(time, WritePrecision.MS); |
| | | writeApiBlocking.writePoint(influxDBInstance.bucket, influxDBInstance.org, point); |
| | | writeApiBlocking.writePoint(influxDBInstance.getBucket(), influxDBInstance.org, point); |
| | | } |
| | | |
| | | @Override |
| | |
| | | point.addTag("point", pointNo); |
| | | point.addField("value", Integer.parseInt(dataValue)); |
| | | point.time(time, WritePrecision.MS); |
| | | writeApiBlocking.writePoint(influxDBInstance.bucket, influxDBInstance.org, point); |
| | | writeApiBlocking.writePoint(influxDBInstance.getBucket(), influxDBInstance.org, point); |
| | | } |
| | | |
| | | @Override |
| | |
| | | point.addTag("point", pointNo); |
| | | point.addField("value", Boolean.parseBoolean(dataValue)); |
| | | point.time(time, WritePrecision.MS); |
| | | writeApiBlocking.writePoint(influxDBInstance.bucket, influxDBInstance.org, point); |
| | | writeApiBlocking.writePoint(influxDBInstance.getBucket(), influxDBInstance.org, point); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | if (!CollectionUtils.isEmpty(pointValues)) { |
| | | pointValues.forEach(item -> { |
| | | writeApi.writeMeasurement(influxDBInstance.bucket, influxDBInstance.org, WritePrecision.MS, item); |
| | | writeApi.writeMeasurement(influxDBInstance.getBucket(), influxDBInstance.org, WritePrecision.MS, item); |
| | | }); |
| | | } |
| | | writeApi.flush(); |
| | |
| | | } |
| | | if (!CollectionUtils.isEmpty(tagValues)) { |
| | | tagValues.forEach(item -> { |
| | | writeApi.writeMeasurement(influxDBInstance.bucket, influxDBInstance.org, WritePrecision.MS, item); |
| | | writeApi.writeMeasurement(influxDBInstance.getBucket(), influxDBInstance.org, WritePrecision.MS, item); |
| | | }); |
| | | } |
| | | writeApi.flush(); |
| | |
| | | InfluxTagValuePOJO tag = influxParams.get(i); |
| | | String measurement = TagValueUtils.getMeasurement(tag.getType()); |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append("from(bucket:\"" + influxDBInstance.bucket + "\") "); |
| | | sb.append("from(bucket:\"" + influxDBInstance.getBucket() + "\") "); |
| | | sb.append("|> range(start: ").append(start).append(", stop: ").append(stop).append(") "); |
| | | sb.append("|> filter(fn: (r) => r[\"_measurement\"] == \"" + measurement + "\")"); |
| | | sb.append("|> filter(fn: (r) => r[\"_field\"] == \"value\")"); |
| | |
| | | |
| | | String measurement = TagValueUtils.getMeasurement(tag.getType()); |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append("from(bucket:\"" + influxDBInstance.bucket + "\") "); |
| | | sb.append("from(bucket:\"" + influxDBInstance.getBucket() + "\") "); |
| | | sb.append("|> range(start: ").append(start).append(", stop: ").append(stop).append(") "); |
| | | sb.append("|> filter(fn: (r) => r[\"_measurement\"] == \"" + measurement + "\")"); |
| | | sb.append("|> filter(fn: (r) => r[\"_field\"] == \"value\")"); |
| | |
| | | sql.append(" WHERE point = '"); |
| | | sql.append(point.getPoint()); |
| | | sql.append("'"); |
| | | InfluxQLQueryResult data = influxQLQueryApi.query(new InfluxQLQuery(sql.toString(), influxDBInstance.bucket)); |
| | | InfluxQLQueryResult data = influxQLQueryApi.query(new InfluxQLQuery(sql.toString(), influxDBInstance.getBucket())); |
| | | Object value = data.getResults().get(0).getSeries().get(0).getValues().get(0).getValueByKey("last"); |
| | | result.put(point.getPoint(), value); |
| | | } |
| | |
| | | sql.append(" WHERE point = '"); |
| | | sql.append(point.getPoint()); |
| | | sql.append("' AND time >= '" + utsStart +"'"); |
| | | InfluxQLQueryResult data = influxQLQueryApi.query(new InfluxQLQuery(sql.toString(), influxDBInstance.bucket)); |
| | | InfluxQLQueryResult data = influxQLQueryApi.query(new InfluxQLQuery(sql.toString(), influxDBInstance.getBucket())); |
| | | if (data == null) { |
| | | return null; |
| | | } |
| | |
| | | InfluxPointValuePOJO point = influxParams.get(i); |
| | | String measurement = PointValueUtils.getMeasurement(point.getType()); |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append("from(bucket:\"" + influxDBInstance.bucket + "\") "); |
| | | sb.append("from(bucket:\"" + influxDBInstance.getBucket() + "\") "); |
| | | sb.append("|> range(start: ").append(start).append(", stop: ").append(stop).append(") "); |
| | | sb.append("|> filter(fn: (r) => r[\"_measurement\"] == \"" + measurement + "\")"); |
| | | sb.append("|> filter(fn: (r) => r[\"_field\"] == \"value\")"); |