swebb2066 commented on code in PR #567:
URL: https://github.com/apache/logging-log4cxx/pull/567#discussion_r2569991161
##########
src/site/generate_appending_a_log_message.js:
##########
@@ -0,0 +1,98 @@
+
+// Get the DOM container for the plot
+var containerDOM = document.getElementById('appending_a_log_message_plot');
+if (!containerDOM) {
+ throw new Error("Could not find 'appending_a_log_message_plot'
element");
+}
+var myChart = echarts.init(containerDOM, null, { renderer: 'canvas' });
+
+
+// Find the benchmark html table
+var benchmark_data = null;
+var element = document.getElementById('benchmark_data_marker');
+while (element && element.tagName) {
+ if (element.tagName === 'TABLE') {
+ benchmark_data = element;
+ break;
+ }
+ element = element.nextElementSibling;
+}
+if (!benchmark_data) {
+ throw new Error("Could not find benchmark data");;
+}
+
+// Identify the benchmark tests to be included on the plot
+var benchmark_pattern = [];
+benchmark_pattern.push(new RegExp("Appending (.*) using ([A-Za-z]+), pattern:
\\%m\\%n$"));
+benchmark_pattern.push(new RegExp("Async, Sending (.*) using ([A-Za-z <]+)$"));
+const value_regex_pattern = new RegExp("([0-9]+) ns")
+
+// Extract the data
Review Comment:
It is simpler (zero maintenance) to use the data in the page to generate the
graph.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]