Commit 863a3d59 authored by neop's avatar neop
Browse files

try reading from influxdb

parent d9fe6359
*
!*/
# whitelist
!gradle/*
......
......@@ -79,7 +79,7 @@ public class Main {
System.getenv("SENSOR2GRAPH_INFLUXDB_PASS").toCharArray(),
influxdb_database_name,
null
);
).enableGzip();
}
private static Set<String> parse_line_separated_values_file(String fname) throws Exception {
......@@ -96,6 +96,17 @@ public class Main {
}
private static void run() throws Exception {
var queryApi = influxDBClient.getQueryApi();
var tables = queryApi.query("from(bucket:\"sensor\") |> range(start: -1d) |> mean() |> yield(name: \"_results\")");
for (var fluxTable : tables) {
var records = fluxTable.getRecords();
for (var fluxRecord : records) {
System.out.println(fluxRecord.getTime() + ": " + fluxRecord.getValueByKey("_value"));
}
}
// try_uploading_failed_sensors();
// upload_all_days();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment