forked from hyperledger-cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test jmeter benchmarking Signed-off-by: ruzell22 <[email protected]>
- Loading branch information
Showing
3 changed files
with
38 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,38 @@ | ||
const Benchmark = require('benchmark'); | ||
const suite = new Benchmark.Suite(); | ||
const { fib } = require('./index'); | ||
// const Benchmark = require("benchmark"); | ||
var suite = new Benchmark.Suite(); | ||
|
||
// add tests | ||
suite | ||
.add("fib(10)", () => { | ||
fib(10); | ||
.add("RegExp#test", function () { | ||
/o/.test("Hello World!"); | ||
}) | ||
.add("fib(20)", () => { | ||
fib(20); | ||
.add("String#indexOf", function () { | ||
"Hello World!".indexOf("o") > -1; | ||
}) | ||
.on("cycle", (event) => { | ||
.add("String#match", function () { | ||
!!"Hello World!".match(/o/); | ||
}) | ||
// add listeners | ||
.on("cycle", function (event) { | ||
console.log(String(event.target)); | ||
}) | ||
.run(); | ||
.on("complete", function () { | ||
console.log("Fastest is " + this.filter("fastest").map("name")); | ||
}) | ||
// run async | ||
.run({ async: true }); | ||
|
||
// const suite = new Benchmark.Suite(); | ||
// const { fib } = require('./index'); | ||
|
||
// suite | ||
// .add("fib(10)", () => { | ||
// fib(10); | ||
// }) | ||
// .add("fib(20)", () => { | ||
// fib(20); | ||
// }) | ||
// .on("cycle", (event) => { | ||
// console.log(String(event.target)); | ||
// }) | ||
// .run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "rhysd <[email protected]> (https://rhysd.github.io/)", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"benchmark": "^2.1.4" | ||
|