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; }
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); }
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); }
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); }