コード例 #1
0
 private void navBarItem28_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs ee)
 {
     FlowControlMapBvc fcmb = new FlowControlMapBvc();
     clearColumns();
     var dborder = from p in fcmb.QueryMongo().OrderByDescending(e => e.fcb_cnt)
                   select new
                   {
                       p.lac_cell,
                       p.bvci,
                       p.fcb_cnt,
                       p.packet_cnt,
                       p.tlli_cnt,
                       radio_status = p.msg_distinct_aggre.CountMessage("BSSGP.RADIO-STATUS"),
                       p.ms_leak_rate,
                       p.ms_bucket_size,
                       p.bssgp_bmax_default_ms,
                       p.bssgp_bucket_full_ratio,
                       p.bssgp_bucket_leak_rate,
                       p.bssgp_bvc_bucket_size,
                       p.bssgp_ms_bucket_size,
                       p.bssgp_R_default_ms,
                       p.down_packet_rate,
                       p.down_total_len,
                       p.fcb_delay_aggre,
                       p.fcb_time_aggre,
                       p.msg_distinct_aggre,
                       p.tlli_distinct_aggre
                   };
     gridControl1.DataSource = dborder.AsParallel().ToList();
     gridView1.OptionsView.ColumnAutoWidth = true;
 }
コード例 #2
0
        private void navBarItem30_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs ee)
        {
            clearColumns();
            FlowControlMapBvc fcmb = new FlowControlMapBvc();
            var bvc = fcmb.QueryMongo().ToList();
            LacCellBvci lcb = new LacCellBvci();
            var cell = from p in lcb.QueryMongo().ToList()
                       group p by p.lac_cell into ttt
                       select new
                       {
                           lac_cell = ttt.Key,
                           bvci_aggre = ttt.Select(e => e.bvci).Aggregate((a, b) => a + "," + b),

                       };
            var query = from p in bvc
                        join q in cell on p.lac_cell equals q.lac_cell
                        select new
                        {
                            p.lac_cell,
                            p.fcb_cnt,
                            p.packet_cnt,
                            p.tlli_cnt,
                            q.bvci_aggre,
                            radio_status = p.msg_distinct_aggre.CountMessage("BSSGP.RADIO-STATUS"),
                            p.ms_leak_rate,
                            p.ms_bucket_size,
                            p.bssgp_bmax_default_ms,
                            p.bssgp_bucket_full_ratio,
                            p.bssgp_bucket_leak_rate,
                            p.bssgp_bvc_bucket_size,
                            p.bssgp_ms_bucket_size,
                            p.bssgp_R_default_ms,
                            p.down_packet_rate,
                            p.down_total_len,
                            p.fcb_delay_aggre,
                            p.fcb_time_aggre,
                            p.msg_distinct_aggre,
                            p.tlli_distinct_aggre
                        };

            gridControl1.DataSource = query.OrderByDescending(e => e.fcb_cnt).AsParallel().ToList();
            gridView1.OptionsView.ColumnAutoWidth = true;
        }
コード例 #3
0
        private void navBarItem27_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs ee)
        {
            string msfc_msg = "BSSGP.FLOW-CONTROL-MS";
            string fc_msg = "BSSGP.FLOW-CONTROL-BVC";
            //分组
            FlowControlOneBvc fcob = new FlowControlOneBvc();

               var fcobmongo = fcob.QueryMongo().Where(e => e.lac_cell != null).AsParallel().ToList();

            //var fcobmongo = fcob.QueryMongo().Where(e => e.lac_cell != null).AsParallel().AsEnumerable();

            var query = from p in fcobmongo
                        group p by p.lac_cell into ttt
                        select new FlowControlMapBvc
                        {
                            _id = GenerateId(),
                            lac_cell = ttt.Key,
                            //lac_cell = ttt.Key.lac_cell,
                            //bvci=ttt.Key.bvci,
                            fcb_cnt = ttt.Where(e => e.Flow_Control_MsgType == fc_msg).Count(),
                            packet_cnt = ttt.Count(),
                            tlli_cnt = ttt.Select(e => e.tlli).Distinct().Count(),

                            bssgp_R_default_ms = ttt.Where(e => e.Flow_Control_MsgType == fc_msg).Average(e => e.bssgp_R_default_ms),
                            bssgp_ms_bucket_size = ttt.Where(e => e.Flow_Control_MsgType == fc_msg).Average(e => e.bssgp_ms_bucket_size),
                            //bssgp_bvc_bucket_size = ttt.Where(e => e.Flow_Control_MsgType == fc_msg).Average(e => e.bssgp_bvc_bucket_size),
                            //bssgp_bucket_leak_rate = ttt.Where(e => e.Flow_Control_MsgType == fc_msg).Average(e => e.bssgp_bucket_leak_rate),
                            bssgp_bucket_full_ratio = ttt.Where(e => e.Flow_Control_MsgType == fc_msg).Average(e => e.bssgp_bucket_full_ratio),
                            bssgp_bmax_default_ms = ttt.Where(e => e.Flow_Control_MsgType == fc_msg).Average(e => e.bssgp_bmax_default_ms),

                            //用户级别
                            ms_bucket_size = ttt.Where(e => e.Flow_Control_MsgType == msfc_msg).Where(e => e.bssgp_ms_bucket_size > 0).Average(e => e.bssgp_ms_bucket_size),
                            ms_leak_rate = ttt.Where(e => e.Flow_Control_MsgType == msfc_msg).Where(e => e.bssgp_bucket_leak_rate > 0).Average(e => e.bssgp_bucket_leak_rate),

                            fcb_delay_aggre = ttt.Where(e => e.Flow_Control_MsgType == fc_msg).OrderBy(e => e._id)
                                                .Select(e => new { fd = (e.Flow_Control_time - ttt.Min(f => f.Flow_Control_time)).TotalMilliseconds })
                                                .Select(e => (e.fd / 1000).ToString("f1"))
                                                .Aggregate((a, b) => a + "," + b),

                            bssgp_bucket_leak_rate = ttt.Where(e => e.Flow_Control_MsgType == fc_msg)
                            .OrderBy(e => e._id)
                                            .Select(e => (e.bssgp_bucket_leak_rate).ToString("f1"))
                                            .Aggregate((a, b) => a + "," + b),

                            bssgp_bvc_bucket_size = ttt.Where(e => e.Flow_Control_MsgType == fc_msg)
                            .OrderBy(e => e._id)
                                             .Select(e => (e.bssgp_bvc_bucket_size).ToString("f1"))
                                             .Aggregate((a, b) => a + "," + b),

                            ////用扩展方法实现, 在fc消息之间进行ip.len的累加
                            tlli_distinct_aggre = ttt.Select(e => e.tlli).Distinct().Aggregate((a, b) => a + "," + b),

                            msg_distinct_aggre = ttt.Select(e => e.Flow_Control_MsgType).Distinct().Aggregate((a, b) => a + "," + b),

                            down_total_len = ttt.OrderBy(e => e._id)
                            .AggregateSum(e => (int)e.ip_len, e => e.Flow_Control_MsgType, fc_msg),

                            down_packet_rate = ttt.OrderBy(e => e._id)
                            .AggregatePacketRate(e => (int)e.ip_len, e => e.Flow_Control_time, e => e.Flow_Control_MsgType, fc_msg),

                            fcb_time_aggre = ttt.OrderBy(e => e._id)
                            .AggregatePacketTime(e => e.Flow_Control_time, e => e.Flow_Control_MsgType, fc_msg),
                        };

            FlowControlMapBvc fcmb = new FlowControlMapBvc();
            fcmb.BulkMongo(query.ToList());
            MessageBox.Show("OK");
        }