public async Task <IActionResult> Index([FromServices] InfluxDbService influxDbService) { var results = await influxDbService.QueryAsync(async query => { var flux = "from(bucket:\"test-bucket\") |> range(start: 0)"; var tables = await query.QueryAsync(flux, "organization"); return(tables.SelectMany(table => table.Records.Select( record => new AltitudeModel { Time = record.GetTime().ToString(), Altitude = int.Parse(record.GetValue().ToString()) }))); }); return(View(results)); }
public OctopusStoreService(ILogger <OctopusStoreService> logger, InfluxDbService influxDbService, IOptions <InfluxDbService.Config> influxConfigOptions) { Logger = logger; InfluxDb = influxDbService; Bucket = influxConfigOptions.Value.Bucket; }
public RandomPlaneAltitudeWriter(InfluxDbService influxDbService) { _influxDbService = influxDbService; }