Skip to content

Instantly share code, notes, and snippets.

@pavelmash
Created July 20, 2022 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavelmash/bd2a03b6e338ef4017a418a7f1086d76 to your computer and use it in GitHub Desktop.
Save pavelmash/bd2a03b6e338ef4017a418a7f1086d76 to your computer and use it in GitHub Desktop.
Console utility to visualize Techempower benchmark result
// node visualize_tfb_res.js
// expect results.json to be in the same folder
const fs = require('fs')
const res = require('./results.json')
const tests = Object.keys(res.rawData).filter(tc => !tc.endsWith('Counts'))
const tf = {}
const t = {}
for (const tc of tests) {
tf[tc] = {}
t[tc] = {}
for (const fn in res.rawData[tc]) {
tf[tc][fn.padEnd(10, ' ')] = res.rawData[tc][fn].map(v => Math.trunc(v.totalRequests / (v.endTime - v.startTime)))
t[tc][fn.padEnd(10, ' ')] = Math.max(...tf[tc][fn.padEnd(10, ' ')])
}
}
console.log('\nMax RPS:')
console.table ? console.table(t) : console.log(t)
console.log('\nConcurred conn\'s: 16<-->32<---->64<---->128<--->256<--->512')
console.log(tf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment