//To be used for generating %failed calls result html public void GetCallsAndFailedCallsTableHtml( string callsDataFile, string failedCallsDataFile, string perfLogFilePath, string tableTitle, string resultFilePath) { Collection <PerfCounterData> totalCallsPerfCounterDataCollection = this.GetPerfCounterDataCollection(callsDataFile); totalCallsPerfCounterDataCollection = this.PopulatePerfDataFromPerfLogfile( totalCallsPerfCounterDataCollection, perfLogFilePath); Collection <PerfCounterData> failedCallsPerfCounterDataCollection = this.GetPerfCounterDataCollection(failedCallsDataFile); failedCallsPerfCounterDataCollection = this.PopulatePerfDataFromPerfLogfile( failedCallsPerfCounterDataCollection, perfLogFilePath); Collection <CallsData> callsAndFailedCallsDataCollection = this.UnionCallsAndFailedCallsData( totalCallsPerfCounterDataCollection, failedCallsPerfCounterDataCollection); DataTable resultTable = this.GetCallsResultsTable(callsAndFailedCallsDataCollection); CreateReport.GetResultsTableHtml(resultFilePath, tableTitle, resultTable); }
public void GenerateClientReport( string clientCallXml, int testDurationInSec, string targetFolder, string targetFileNamePrefix) { if (targetFileNamePrefix == null) { targetFileNamePrefix = string.Empty; } IEnumerable <ResultOfTest> clientCallsDataCollection = this.GetTestResultsCollection(clientCallXml); var results = clientCallsDataCollection.GroupBy(clientCallsData => clientCallsData.ApiName); Collection <ClientAPIPerfNumbers> clientApiLatencyData = new Collection <ClientAPIPerfNumbers>(); Collection <ClientAPIPercentageFailure> clientApiPercentageFailureData = new Collection <ClientAPIPercentageFailure>(); Collection <APIErrorDetails> clientErrorDetails = new Collection <APIErrorDetails>(); foreach (var apiDetails in results) { clientApiLatencyData.Add(this.GetClientApiLatencyData(apiDetails, testDurationInSec)); clientApiPercentageFailureData.Add(this.GetClientApiFailureData(apiDetails)); clientErrorDetails.Add(this.GetErrorDetails(apiDetails)); } DataTable resultTable = this.GetClientLatencyTable(clientApiLatencyData); CreateReport.GetResultsTableHtml( Path.Combine(targetFolder, string.Format("{0}ClientLatency.html", targetFileNamePrefix)), "WCF Service APIs - Client side - Latency (Sec)", resultTable); resultTable = this.GetClientThroughputTable(clientApiLatencyData); CreateReport.GetResultsTableHtml( Path.Combine(targetFolder, string.Format("{0}ClientThroughput.html", targetFileNamePrefix)), "WCF Service APIs - Client side - Throughput (Calls per sec)", resultTable); resultTable = this.GetClientCallsFailureRateTable(clientApiPercentageFailureData); CreateReport.GetResultsTableHtml( Path.Combine(targetFolder, string.Format("{0}ClientCalls.html", targetFileNamePrefix)), "WCF Service APIs - Client side - Calls", resultTable); resultTable = this.GetClientErrorTable(clientErrorDetails); CreateReport.GetResultsTableHtml( Path.Combine(targetFolder, string.Format("{0}ClientError.html", targetFileNamePrefix)), "WCF Service APIs - Client side - Error Details", resultTable); }
//To be used for generating latency and throughput result html public void GetPerfNumbersTableHtml(string dataFile, string perfLogFilePath, string tableTitle, string resultFilePath) { Collection <PerfCounterData> perfCounterDataCollection = this.GetPerfCounterDataCollection(dataFile); perfCounterDataCollection = this.PopulatePerfDataFromPerfLogfile( perfCounterDataCollection, perfLogFilePath); DataTable resultTable = CreateReport.GetPerfRunResultsTable(perfCounterDataCollection); CreateReport.GetResultsTableHtml(resultFilePath, tableTitle, resultTable); }