private FluxQueryBuilder GetHourDataQuery(DataSourceIdentification dataSourceIdentification, int hour) { if (dataSourceIdentification is null) { throw new ArgumentException(ParameterErrorMessage, nameof(dataSourceIdentification)); } FluxQueryBuilder queryBuilder = new FluxQueryBuilder(); return(queryBuilder.From(dataSourceIdentification.Bucket) .RangePastDays(hour) .AddMeasurementFilter(this.measurementName)); }
public async Task <List <TModel> > GetPastDaysData(DataSourceIdentification dataSourceIdentification, int days) { if (dataSourceIdentification is null) { throw new ArgumentException(ParameterErrorMessage, nameof(dataSourceIdentification)); } FluxQueryBuilder queryBuilder = new FluxQueryBuilder(); string query = queryBuilder.From(dataSourceIdentification.Bucket) .RangePastDays(days) .AddMeasurementFilter(this.measurementName) .CreateQuery(); List <FluxTable> data = await this.context.Client.GetQueryApi().QueryAsync(query, dataSourceIdentification.Organization); return(this.ParseData(data)); }