Esempio n. 1
0
 private static void PrintDistributionStatsReport(DistributionStatsReport report)
 {
     Console.WriteLine("Occurence:");
     HistogramCliPrinter.Print(report.ShardsOccurence);
     Console.WriteLine();
     Console.WriteLine();
     Console.WriteLine("Payload size:");
     HistogramCliPrinter.Print(report.ShardsSize);
 }
Esempio n. 2
0
        public DistributionStatsReport Process(Uri pcapUri, Int32 numberOfShards)
        {
            var shardsOccurence = new UInt64[numberOfShards];
            var shardsSize      = new UInt64[numberOfShards];

            foreach (var rawPacket in this.LoadRawPacketsFromPcap(pcapUri))
            {
                if (!RawPacketEntityIdSetter.SetEntityIdForRawPacket(rawPacket, numberOfShards))
                {
                    continue;
                }

                shardsOccurence[rawPacket.EntityId]++;
                shardsSize[rawPacket.EntityId] += (UInt64)rawPacket.RawPacketData.Length;
            }

            var report = new DistributionStatsReport
            {
                ShardsOccurence = shardsOccurence,
                ShardsSize      = shardsSize
            };

            return(report);
        }