Skip to content

Commit

Permalink
Print perf results as a formatted table
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Aug 24, 2018
1 parent 756196c commit 5508bfb
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions perfBenchmark.js
Expand Up @@ -2,6 +2,7 @@ const express = require("express");
const puppeteer = require("puppeteer");
const tracealyzer = require('tracealyzer');
const spawn = require("cross-spawn");
const Table = require("cli-table2");

const fs = require("fs");

Expand Down Expand Up @@ -199,15 +200,30 @@ app.listen(9999, async () => {

await browser.close();

Object.keys(versionPerfEntries).sort().forEach(version => {
const versionResults = versionPerfEntries[version];

const table = new Table({
head: ['Build', 'Avg FPS', 'Scripting', 'Rendering', 'Painting', 'FPS Values']
});

const rows = VERSIONS.map(version => {
const versionResults = versionPerfEntries[version];
const {fps, profile} = versionResults;

console.log(version);
console.log(" FPS (average, values): ", fps.average, "; ", fps.values);
console.log(" Profile: ", profile)
})
const rowContents = [
version,
fps.average.toFixed(2),
profile.scripting.toFixed(2),
profile.rendering.toFixed(2),
profile.painting.toFixed(2),
fps.values.toString()
]

return rowContents;
});

table.push(...rows);

console.log(table.toString());


process.exit(0);
Expand Down

0 comments on commit 5508bfb

Please sign in to comment.