public async Task <Segment <ActivationEvent> > GetActiveContainerTimelineAsync(DateTime start, DateTime end, string continuationToken) { var query = ContainerActiveEntity.GetQuery(start, end); var results = await _instanceTable.SafeExecuteQueryAsync(query); List <ActivationEvent> l = new List <ActivationEvent>(); Dictionary <string, string> intern = new Dictionary <string, string>(); foreach (var result in results) { var name = result.GetContainerName(); string internedName; if (!intern.TryGetValue(name, out internedName)) { intern[name] = name; internedName = name; } var timeBucket = result.GetStartBucket(); l.Add(new ActivationEvent { ContainerName = name, StartTimeBucket = timeBucket, StartTime = TimeBucket.ConvertToDateTime(timeBucket), Length = result.GetLength() }); } return(new Segment <ActivationEvent>(l.ToArray(), null)); }
public DateTime GetEpoch() { var bucket = GetTimeBucket(); return(TimeBucket.ConvertToDateTime(bucket)); }