From 868d116961bfbcae26c106a1d31a2aea1352ad85 Mon Sep 17 00:00:00 2001 From: jaakko Date: Tue, 14 Apr 2026 08:27:01 +0300 Subject: [PATCH] Benchmark: HTML-webbiraportit tuloksista MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Standalone HTML-tiedosto joka sisältää: - Yhteenvetokortit (keskiarvo, paras malli, nopein, testit) - Mallikohtainen taulukko palkkikaavioilla - Yksittäiset tulokset sortattavassa taulussa - Dark mode, ei ulkoisia dependencyjä --- network-poc/tests/model-benchmark.mjs | 13 +- network-poc/tests/report-template.html | 167 +++++++++++++++++++++++++ 2 files changed, 178 insertions(+), 2 deletions(-) create mode 100644 network-poc/tests/report-template.html diff --git a/network-poc/tests/model-benchmark.mjs b/network-poc/tests/model-benchmark.mjs index c699a1f..f2e87e5 100644 --- a/network-poc/tests/model-benchmark.mjs +++ b/network-poc/tests/model-benchmark.mjs @@ -542,9 +542,18 @@ async function main() { console.log(row); } - // Tallenna JSON + // Tallenna JSON + HTML-raportti writeFileSync(`${OUTPUT_DIR}/results.json`, JSON.stringify(results, null, 2)); - console.log(`\nJSON: ${OUTPUT_DIR}/results.json`); + const templatePath = join(__dirname, 'report-template.html'); + if (existsSync(templatePath)) { + const html = readFileSync(templatePath, 'utf-8').replace( + '/*DATA_PLACEHOLDER*/[]', + JSON.stringify(results) + ); + writeFileSync(`${OUTPUT_DIR}/report.html`, html); + console.log(`\nRaportti: ${OUTPUT_DIR}/report.html`); + } + console.log(`JSON: ${OUTPUT_DIR}/results.json`); // Yhteenveto const passed = results.filter(r => !r.error && r.testsPassed === r.testsTotal && r.testsTotal > 0); diff --git a/network-poc/tests/report-template.html b/network-poc/tests/report-template.html new file mode 100644 index 0000000..7c7c417 --- /dev/null +++ b/network-poc/tests/report-template.html @@ -0,0 +1,167 @@ + + + + + +Kipina Model Benchmark + + + + +

Kipina Model Benchmark

+
+ +
+ +

Mallikohtainen yhteenveto

+
+ +

Kaikki tulokset

+
+ + + +