public QueryMultiSeriesAsync ( string dbName, string measurementQuery, TimePrecision precision = TimePrecision.Nanoseconds ) : Task
|
||
dbName | string | Name of the database |
measurementQuery | string | Query text, Only results with single series are supported for now |
precision | TimePrecision | epoch precision of the data set |
Résultat | Task
|
public async Task <double> SumTheWaterLevel(string endpoint, string database) { var client = new InfluxDBClient(endpoint); var query = "SELECT water_level FROM h2o_feet"; var results = await client.QueryMultiSeriesAsync(database, query); var serie = results.Single(); double total = 0; foreach (dynamic entry in serie.Entries) { // Not sure why but water_level comes back as a string. total += double.Parse(entry.Water_level); } return(total); }