public void UploadFlowHuaweis(StreamReader reader) { var originCsvs = FlowHuaweiCsv.ReadFlowHuaweiCsvs(reader); var mergedCsvs = (from item in originCsvs group item by new { item.StatTime.Date, item.CellInfo } into g select new FlowHuaweiCsv { StatTime = g.Key.Date, AverageActiveUsers = g.Average(x => x.AverageActiveUsers), AverageUsers = g.Average(x => x.AverageUsers), ButLastDownlinkDurationInMs = g.Sum(x => x.ButLastDownlinkDurationInMs), ButLastUplinkDurationInMs = g.Sum(x => x.ButLastUplinkDurationInMs), CellInfo = g.Key.CellInfo, DedicatedPreambles = g.Sum(x => x.DedicatedPreambles), DownlinkAveragePrbs = g.Average(x => x.DownlinkAveragePrbs), DownlinkAverageUsers = g.Average(x => x.DownlinkAverageUsers), DownlinkDciCces = g.Sum(x => x.DownlinkDciCces), DownlinkDrbPbs = g.Average(x => x.DownlinkDrbPbs), DownlinkDurationInMs = g.Sum(x => x.DownlinkDurationInMs), DownlinkMaxUsers = g.Max(x => x.DownlinkMaxUsers), GroupAPreambles = g.Sum(x => x.GroupAPreambles), GroupBPreambles = g.Sum(x => x.GroupBPreambles), LastTtiDownlinkFlowInByte = g.Sum(x => x.LastTtiDownlinkFlowInByte), LastTtiUplinkFlowInByte = g.Sum(x => x.LastTtiUplinkFlowInByte), MaxActiveUsers = g.Max(x => x.MaxActiveUsers), MaxUsers = g.Max(x => x.MaxUsers), PagingUsersString = g.First().PagingUsersString, PdcpDownlinkFlowInByte = g.Sum(x => x.PdcpDownlinkFlowInByte), PdcpUplinkFlowInByte = g.Sum(x => x.PdcpUplinkFlowInByte), PucchPrbsString = g.Sum(x => x.PucchPrbsString.ConvertToInt(0)).ToString(), TotalCces = g.Sum(x => x.TotalCces), UplinkAveragePrbs = g.Average(x => x.UplinkAveragePrbs), UplinkAverageUsers = g.Average(x => x.UplinkAverageUsers), UplinkDciCces = g.Sum(x => x.UplinkDciCces), UplinkDrbPbs = g.Sum(x => x.UplinkDrbPbs), UplinkDurationInMs = g.Sum(x => x.UplinkDurationInMs), UplinkMaxUsers = g.Max(x => x.UplinkMaxUsers) }).ToList(); var flows = Mapper.Map <List <FlowHuaweiCsv>, IEnumerable <FlowHuawei> >(mergedCsvs); foreach (var flow in flows) { FlowHuaweis.Push(flow); } }
public async Task <bool> DumpOneHuaweiStat() { var stat = FlowHuaweis.Pop(); if (stat.Item1 != null) { await _huaweiRepository.ImportOneAsync(stat.Item1); } if (stat.Item2 != null) { await _rrcHuaweiRepository.ImportOneAsync(stat.Item2); } if (stat.Item3 != null) { await _qciHuaweiRepository.ImportOneAsync(stat.Item3); } if (stat.Item4 != null) { await _prbHuaweiRepository.ImportOneAsync(stat.Item4); } return(true); }
public void UploadFlowHuaweis(StreamReader reader) { var originCsvs = FlowHuaweiCsv.ReadFlowHuaweiCsvs(reader); var mergedCsvs = (from item in originCsvs group item by new { item.StatTime.Date, item.CellInfo } into g select g.ArrayAggration(stat => { stat.StatTime = g.Key.Date; stat.CellInfo = g.Key.CellInfo; })).ToList(); foreach (var csv in mergedCsvs) { FlowHuaweis.Push( new Tuple <FlowHuawei, RrcHuawei, QciHuawei, PrbHuawei>(Mapper.Map <FlowHuaweiCsv, FlowHuawei>(csv), Mapper.Map <FlowHuaweiCsv, RrcHuawei>(csv), Mapper.Map <FlowHuaweiCsv, QciHuawei>(csv), Mapper.Map <FlowHuaweiCsv, PrbHuawei>(csv))); } }
public void ClearHuaweiStats() { FlowHuaweis.Clear(); }
public FlowHuawei QueryHuaweiStat(int index) { return(FlowHuaweis.ElementAt(index)); }
public FlowHuawei GetTopHuaweiItem() { return(FlowHuaweis.Pop()); }