示例#1
0
 public PacketLengthsStatisticsTreeModel(PacketStatByLength packetStatByLength)
 {
     Start   = packetStatByLength.Start;
     End     = packetStatByLength.End;
     Count   = packetStatByLength.Num;
     Average = packetStatByLength.Average;
     MaxVal  = packetStatByLength.MaxVal;
     MinVal  = packetStatByLength.MinVal;
     Rate    = packetStatByLength.Rate;
     Percent = packetStatByLength.PercentNum;
 }
示例#2
0
        public static PacketLengthsStatisticsTreeModel getPacketLengthStatisticsByTime(int i)
        {
            serviceStackDBHelper = ServiceStackDBHelper.getInstance();
            Tuple <int, int>   tuple = GetStartEnd(i);
            PacketStatByLength packetStatByLength = serviceStackDBHelper.PacketStatisticsByLength(tuple.Item1, tuple.Item2);

            if (packetStatByLength != null)
            {
                return(new PacketLengthsStatisticsTreeModel(packetStatByLength));
            }
            return(null);
        }
示例#3
0
        public static List <PacketLengthsStatisticsTreeModel> getPacketLengthStatisticsAll()
        {
            serviceStackDBHelper = ServiceStackDBHelper.getInstance();
            List <PacketLengthsStatisticsTreeModel> packetLengthsStatisticsTreeModels = new List <PacketLengthsStatisticsTreeModel>();

            PacketStatByLength packetStatByLength = null;

            for (int i = 0; i <= 10; i++)
            {
                Tuple <int, int> tuple = GetStartEnd(i);
                packetStatByLength = serviceStackDBHelper.PacketStatisticsByLength(tuple.Item1, tuple.Item2);
                packetLengthsStatisticsTreeModels.Add(new PacketLengthsStatisticsTreeModel(packetStatByLength));
            }
            return(packetLengthsStatisticsTreeModels);
        }
示例#4
0
        public PacketStatByLength PacketStatisticsByLength(int start, int end)
        {
            string             sql     = Globals.sqlToString("PacketByLength.sql");
            PacketStatByLength results = null;

            using (db = dbFactory.Open())
            {
                try
                {
                    results = db.Single <PacketStatByLength>(sql, new { start = start, end = end });
                }
                catch (Exception)
                {
                }
            }
            if (results != null)
            {
                results.Start = start;
                results.End   = end;
            }
            return(results);
        }