Skip to content

Commit

Permalink
Jmeterbenchmark
Browse files Browse the repository at this point in the history
test jmeter benchmarking

Signed-off-by: ruzell22 <[email protected]>
  • Loading branch information
ruzell22 committed Jan 15, 2024
1 parent 0ce3394 commit 351301d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
const Benchmark = require('benchmark');
const suite = new Benchmark.Suite();
const { fib } = require('./index');
// const { exec } = require('child_process');
// const benchmarkBesu = "benchmark-besu";
// const { fib } = require('./index');
const { exec } = require('child_process');
const benchmarkBesu = "benchmark-besu";

suite;
exec(`npm run ${benchmarkBesu}`, (error, stdout) => {

Check failure on line 8 in packages/cactus-plugin-ledger-connector-besu/src/test/benchmarkjs/bench.js

View workflow job for this annotation

GitHub Actions / yarn_lint

'stdout' is defined but never used
if (error) {
console.error();
return;
}

on("cycle", (event) => {
console.log(String(event.target));
}).run();

// console.log(`Script output:\n${stdout}`);
});

// suite
// exec(`npm run ${benchmarkBesu}`, (error, stdout) => {
// if (error) {
// console.error();
// return;
// }
// on("cycle", (event) => {
// .add("fib(10)", () => {
// fib(10);
// })
// .add("fib(20)", () => {
// fib(20);
// })
// .on("cycle", (event) => {
// console.log(String(event.target));
// })
// .run();

// // console.log(`Script output:\n${stdout}`);
// });

suite
.add("fib(10)", () => {
fib(10);
})
.add("fib(20)", () => {
fib(20);
})
.on("cycle", (event) => {
console.log(String(event.target));
})
.run();
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
function fib(n) {
if (n <= 1) {
return 1;
}
return fib(n - 2) + fib(n - 1);
if (n <= 1) {
return 1;
}
return fib(n - 2) + fib(n - 1);
}

exports.fib = fib;
exports.fib = fib;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"benchmark-besu": "ts-node ./packages/cactus-plugin-ledger-connector-besu/src/test/typescript/integration/plugin-ledger-connector-besu/deploy-contract/private-deploy-contract-from-json-web3-eea.test.ts"
},
"author": "rhysd <[email protected]> (https://rhysd.github.io/)",
"license": "MIT",
Expand Down

0 comments on commit 351301d

Please sign in to comment.