Пример #1
0
        private static void ProcessData(string resPath, string dataPath, TimeSpan period)
        {
            var sessions = LogReader.Parse(dataPath, TimePeriod.Create(period));
            sessions.AddRange(IisLogReader.ReadIisData(dataPath));

            var options = new AnalysisOptions
                {
                    LocationIncludeOverall = true
                };

            var convertor = new StatsBuilder();
            var res = convertor.Process(sessions, options);

            var summaryReport = Report.GetSummaryReport(sessions);
            File.WriteAllText(resPath + "\\Summary.txt", summaryReport, Encoding.UTF8);

            var statSummariesReport = Report.GetLatencyStatSummariesReport(res, options);
            File.WriteAllText(resPath + "\\LatencyStatSummaries.txt", statSummariesReport, Encoding.UTF8);

            var latencyDistributionReport = Report.GetLatencyDistributionReport(res);
            File.WriteAllText(resPath + "\\LatencyDistribution.txt", latencyDistributionReport, Encoding.UTF8);

            var jitterDsitributionReport = Report.GetJitterDistributionReport(res);
            File.WriteAllText(resPath + "\\JitterDistribution.txt", jitterDsitributionReport, Encoding.UTF8);
        }
Пример #2
0
        public void TestInternalValidation()
        {
            var dataPath = Util.GetAppLocation() + @"\Data\";
            var sessions = LogReader.Parse(dataPath, TimePeriod.Unlimited);
            Assert.IsTrue(sessions.Count > 0);

            var options = new AnalysisOptions { ApplicationKey = "CIAPI.CS.Excel" };
            var convertor = new StatsBuilder();
            var res = convertor.Process(sessions, options);
            Assert.IsTrue(res != null);

            var summaryReport = Report.GetSummaryReport(sessions);
            Assert.IsTrue(summaryReport != null);
        }
Пример #3
0
        public void TestReportsCorrectness()
        {
            var dataPath = Util.GetAppLocation() + @"\Data\";
            var sessions = LogReader.Parse(dataPath, TimePeriod.Unlimited);
            Assert.IsTrue(sessions.Count > 0);

            var options = new AnalysisOptions
                {
                    ApplicationKey = "CIAPI.CS.Excel",
                    LocationIncludeOverall = true,
                };
            var convertor = new StatsBuilder();
            var res = convertor.Process(sessions, options);
            Assert.IsTrue(res != null);

            var resultsPath = Util.GetAppLocation() + @"\Results\";

            {
                var summaryReport = Report.GetSummaryReport(sessions);
                var summarySample = File.ReadAllText(resultsPath + "TestData.Summary.txt");
                Assert.AreEqual(summaryReport, summarySample);
            }

            {
                var latencySummariesReport = Report.GetLatencyStatSummariesReport(res, options);
                var latencySummariesSample = File.ReadAllText(resultsPath + "TestData.LatencyStatSummaries.txt");
                Assert.AreEqual(latencySummariesSample, latencySummariesReport);
            }

            {
                var latencyDistributionReport = Report.GetLatencyDistributionReport(res);
                var latencyDistributionSample = File.ReadAllText(resultsPath + "TestData.LatencyDistribution.txt");
                Assert.AreEqual(latencyDistributionSample, latencyDistributionReport);
            }

            {
                var jitterDistributionReport = Report.GetJitterDistributionReport(res);
                var jitterDistributionSample = File.ReadAllText(resultsPath + "TestData.JitterDistribution.txt");
                Assert.AreEqual(jitterDistributionSample, jitterDistributionReport);
            }
        }
Пример #4
0
        static List<CalcResult> CreateReport(AnalysisOptions options)
        {
            var sessions = LogReader.Parse(options);

            var convertor = new StatsBuilder();
            var res = convertor.Process(sessions, options);

            return res;
        }