public FrozenPeriod( DateTime StartTime, DateTime EndTime, CompactionLevel Compaction) { this.StartTime = StartTime; this.EndTime = EndTime; this.Compaction = Compaction; }
public FrozenPeriod( DateTime StartTime, DateTime EndTime, CompactionLevel Compaction) { this.StartTime = StartTime; this.EndTime = EndTime; this.Compaction = Compaction; }
/// <summary> /// Partitions the given time period by its compaction level. The resulting /// sequence of compaction periods is ordered. /// </summary> public static Task <IEnumerable <FrozenPeriod> > PartitionByCompaction( DataConnection Connection, DateTime Start, DateTime End, CompactionLevel Compaction = CompactionLevel.None) { // Use '0' as a dummy sensor ID. We won't be looking at // the sensor's measurements, anyway. // TODO: maybe create a separate class for this. var cache = new AggregationCache(Connection, 0, Start, End); return(cache.PartitionByCompaction(Start, End, Compaction)); }
public static CompactionLevel Min(CompactionLevel Left, CompactionLevel Right) { if ((int)Left > (int)Right) { return(Right); } else { return(Left); } }
/// <summary> /// Partitions the given time period by its compaction level. The resulting /// sequence of compaction periods is ordered. The given compaction level /// specifies the minimal compaction for this period of time. /// </summary> public async Task <IEnumerable <FrozenPeriod> > PartitionByCompaction( DateTime Start, DateTime End, CompactionLevel Compaction) { // Start with a single period of time, // and then subdivide that iteratively. var results = new List <FrozenPeriod>(); results.Add(new FrozenPeriod(Start, End, Compaction)); foreach (var item in await FetchFrozenPeriodsAsync()) { var newResults = new List <FrozenPeriod>(); foreach (var range in results) { newResults.AddRange(SubdivideCompactionPeriod(range, item)); } results = newResults; } return(results); }
public static CompactionLevel Min(CompactionLevel Left, CompactionLevel Right) { if ((int)Left > (int)Right) return Right; else return Left; }
/// <summary> /// Partitions the given time period by its compaction level. The resulting /// sequence of compaction periods is ordered. /// </summary> public static Task<IEnumerable<FrozenPeriod>> PartitionByCompaction( DataConnection Connection, DateTime Start, DateTime End, CompactionLevel Compaction = CompactionLevel.None) { // Use '0' as a dummy sensor ID. We won't be looking at // the sensor's measurements, anyway. // TODO: maybe create a separate class for this. var cache = new AggregationCache(Connection, 0, Start, End); return cache.PartitionByCompaction(Start, End, Compaction); }
/// <summary> /// Partitions the given time period by its compaction level. The resulting /// sequence of compaction periods is ordered. The given compaction level /// specifies the minimal compaction for this period of time. /// </summary> public async Task<IEnumerable<FrozenPeriod>> PartitionByCompaction( DateTime Start, DateTime End, CompactionLevel Compaction) { // Start with a single period of time, // and then subdivide that iteratively. var results = new List<FrozenPeriod>(); results.Add(new FrozenPeriod(Start, End, Compaction)); foreach (var item in await FetchFrozenPeriodsAsync()) { var newResults = new List<FrozenPeriod>(); foreach (var range in results) { newResults.AddRange(SubdivideCompactionPeriod(range, item)); } results = newResults; } return results; }