Exemplo n.º 1
0
        public List <FlowView> QueryTopDownSwitchViews(string city, string district, DateTime begin, DateTime end,
                                                       int topCount, OrderDownSwitchPolicy policy)
        {
            var joinViews = QueryDistrictViews(city, district, begin, end);

            return(QueryTopViewsByPolicy(joinViews, topCount, policy));
        }
Exemplo n.º 2
0
        public List <FlowView> QueryTopDownSwitchViews(DateTime begin, DateTime end, int topCount,
                                                       OrderDownSwitchPolicy policy)
        {
            var zteStats    = ZteRepository.GetHighDownSwitchList(begin, end, DownSwitchThreshold);
            var huaweiStats = HuaweiRepository.GetHighDownSwitchList(begin, end, DownSwitchThreshold);
            var joinViews   =
                HuaweiCellRepository.QueryAllFlowViews <FlowView, FlowZte, FlowHuawei>(zteStats, huaweiStats);

            return(joinViews.ToList().QueryTopViewsByPolicy(topCount, policy));
        }
Exemplo n.º 3
0
        private List <FlowView> QueryTopViewsByPolicy(IEnumerable <FlowView> source, int topCount,
                                                      OrderDownSwitchPolicy policy)
        {
            switch (policy)
            {
            case OrderDownSwitchPolicy.OrderByDownSwitchCountsDescendings:
                return(source.OrderByDescending(x => x.RedirectCdma2000).Take(topCount).ToList());

            case OrderDownSwitchPolicy.OrderByDownSwitchRateDescending:
                return(source.OrderByDescending(x => x.DownSwitchRate).Take(topCount).ToList());
            }
            return(new List <FlowView>());
        }
Exemplo n.º 4
0
        public static List <FlowView> QueryTopViewsByPolicy(this List <FlowView> source, int topCount,
                                                            OrderDownSwitchPolicy policy)
        {
            var minDate = source.Min(x => x.StatTime);
            var maxDate = source.Max(x => x.StatTime);

            topCount *= (maxDate - minDate).Days + 1;
            switch (policy)
            {
            case OrderDownSwitchPolicy.OrderByDownSwitchCountsDescendings:
                return(source.OrderByDescending(x => x.RedirectCdma2000).Take(topCount).ToList());

            case OrderDownSwitchPolicy.OrderByDownSwitchRateDescending:
                return(source.OrderByDescending(x => x.DownSwitchRate).Take(topCount).ToList());

            default:
                return(new List <FlowView>());
            }
        }
Exemplo n.º 5
0
        public List <FlowView> QueryTopDownSwitchViews(DateTime begin, DateTime end, int topCount, OrderDownSwitchPolicy policy)
        {
            var zteViews =
                ZteRepository.GetAllList(
                    x => x.StatTime >= begin && x.StatTime < end && x.RedirectA2 + x.RedirectB2 > 2000)
                .MapTo <IEnumerable <FlowView> >();
            var huaweiViews =
                HuaweiRepository.GetAllList(x => x.StatTime >= begin && x.StatTime < end && x.RedirectCdma2000 > 2000)
                .MapTo <IEnumerable <FlowView> >();
            var joinViews = zteViews.Concat(huaweiViews);

            return(QueryTopViewsByPolicy(joinViews, topCount, policy));
        }