Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 public OctopusStoreService(ILogger <OctopusStoreService> logger, InfluxDbService influxDbService, IOptions <InfluxDbService.Config> influxConfigOptions)
 {
     Logger   = logger;
     InfluxDb = influxDbService;
     Bucket   = influxConfigOptions.Value.Bucket;
 }
Exemplo n.º 3
0
 public RandomPlaneAltitudeWriter(InfluxDbService influxDbService)
 {
     _influxDbService = influxDbService;
 }