Exemple #1
0
        public string Build(JMeterData data, TemplatesProvider provider)
        {
            var allResultsTableTemplate = provider.AllResultsTableTemplate;
            var sb = new StringBuilder();
            var i = 0;
            foreach (var row in data.Rows)
            {
                BuildRow(row.PlainData, sb, i);
                i++;
            }

            return string.Format(allResultsTableTemplate, sb);
        }
Exemple #2
0
        public string Build(Dictionary<string, object> summary, string methodName, TemplatesProvider provider)
        {
            var allResultsTableTemplate = provider.SummaryTableTemplate;
            var sb = new StringBuilder();
            var i = 0;
            foreach (var row in summary)
            {
                var rowClass = i % 2 == 0 ? "evenRow" : "oddRow";
                sb.AppendLine($"<tr class=\"{rowClass}\"><td>{row.Key}</td><td>{row.Value}</td></tr>");
                i++;
            }

            return string.Format(allResultsTableTemplate, methodName, sb);
        }
Exemple #3
0
        private string process(JMeterData allData, TemplatesProvider provider)
        {
            // let split them by label
            var jDatas = from row in allData.Rows
                         group row by row.Label into grouped
                         select new JMeterData(grouped.ToList(), grouped.Key.Trim());

            var sb = new StringBuilder();

            foreach (var methodData in jDatas)
            {
                var summary = methodData.PrepareSummary();
                var summaryTable = new HtmlSummaryBuilder().Build(summary, methodData.MethodName, provider);
                sb.Append(summaryTable);
            }

            var allResultstable = new HtmlTableBuilder().Build(allData, provider);

            var formatted = string.Format(provider.HtmlPageTemplate, sb.ToString(), allResultstable);
            return formatted;
        }
Exemple #4
0
 public CsvProcessor(Config configuration)
 {
     _config = configuration;
     _templatesProvider = new TemplatesProvider(_config);
 }