예제 #1
0
        private List <ReportInformation> GenerateInformation()
        {
            var loadTest          = LoadTest;
            var log               = loadTest.Log;
            var currentDiagnostic = loadTest.Diagnostic;

            var reports = new List <ReportInformation>();

            currentDiagnostic.Processes.ForEach(p =>
            {
                var logLines             = log.Lines.Where(l => l.ProcessId.Equals(p.Id)).ToList();
                var processResponse      = new ProcessResponse(logLines, p.Id);
                List <string> yaxisGraph = GetFormatedData(processResponse);
                var reportInformation    = new Dictionary <string, string>();

                reportInformation.Add("%RenderPoints%", string.Join(",", yaxisGraph));
                reportInformation.Add("%GraphTitle%", string.Format("Performance Graphic {0} with , {1} messages", p.Id, p.Messages));
                reportInformation.Add("%SendedMessages%", p.UnprocessedMessages.ToString());
                reportInformation.Add("%RecievedMessages%", p.ProcessedMessages.ToString());
                reportInformation.Add("%ProcessedMessages%", p.UnprocessedMessages.ToString());
                reportInformation.Add("%AverageTimeResponse%", processResponse.AverageProcess.ToString() + " ms");

                var report = new ReportInformation.Builder(p.Id)
                             .WithAttributes(reportInformation)
                             .ByLoadTest(loadTest)
                             .Build();

                reports.Add(report);
            });

            return(reports);
        }
예제 #2
0
        private ReportInformation GenerateInformation()
        {
            var loadTest   = LoadTest;
            var log        = loadTest.Log;
            var diagnostic = loadTest.Diagnostic;

            var reportInformation     = new Dictionary <string, string>();
            var tableProcessesBuilder = new StringBuilder();
            var orderesProcesses      = diagnostic.Processes.OrderBy(p => p.Id).ToList();
            var processChart          = new List <string>();
            var multilineChart        = new List <string>();

            orderesProcesses.ForEach(p =>
            {
                var logLines           = log.Lines.Where(l => l.ProcessId.Equals(p.Id)).ToList();
                var processResponse    = new ProcessResponse(logLines, p.Id);
                var yaxisGraph         = new List <string>();
                var processMessageCont = 0;

                tableProcessesBuilder.Append(GenerateHeader(p.Id));
                tableProcessesBuilder.Append(GenerateRow("Sended Messages :", (loadTest.MessagesByClient).ToString()));
                tableProcessesBuilder.Append(GenerateRow("Recived Messages :", p.UnprocessedMessages.ToString()));
                tableProcessesBuilder.Append(GenerateRow("Processed Messages:", p.ProcessedMessages.ToString()));
                tableProcessesBuilder.Append(GenerateRow("Details:", String.Format("<a href=\"Report{0}.html\">{1}</a>", p.Id, "Click Here")));

                processResponse.Messages.ForEach(pA => { yaxisGraph.Add(GetLinesProcessData(pA, processMessageCont++)); });
                multilineChart.Add(CreateMultilineChart(string.Join(",", yaxisGraph), p.Id));
                processChart.Add(GeneratechartData(processResponse));
            });


            reportInformation.Add("%SendedMessages%", loadTest.TotalSendedMessages.ToString());
            reportInformation.Add("%TotalProcesses%", loadTest.Clients.ToString());
            reportInformation.Add("%RecievedMessages%", log.RecievedMessages.ToString());
            reportInformation.Add("%ProcessedMessages%", log.ProcessedMessages.ToString());
            reportInformation.Add("%ProcessTable%", tableProcessesBuilder.ToString());
            reportInformation.Add("%ProcessChart%", string.Join(",", processChart));
            reportInformation.Add("%LineMessagesCalls%", string.Join(",", multilineChart));

            var report = new ReportInformation.Builder(loadTest.Id)
                         .WithAttributes(reportInformation)
                         .ByLoadTest(loadTest)
                         .Build();

            return(report);
        }