blaze-performance-tester 1.1.14 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +4 -5
- package/index.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// cli.ts
|
|
2
2
|
import path from "path";
|
|
3
|
-
import { fileURLToPath } from "url";
|
|
4
|
-
import { createRequire } from "module";
|
|
5
|
-
var require2 = createRequire(import.meta.url);
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from "url";
|
|
6
4
|
var __filename = fileURLToPath(import.meta.url);
|
|
7
5
|
var __dirname = path.dirname(__filename);
|
|
8
|
-
var
|
|
6
|
+
var indexPath = path.resolve(__dirname, "../index.js");
|
|
7
|
+
var { runBlazeCore } = await import(pathToFileURL(indexPath).href);
|
|
9
8
|
var args = process.argv.slice(2);
|
|
10
9
|
if (args.length < 3) {
|
|
11
10
|
console.error("Usage: npx blaze-performance-tester <script-path> <vus> <duration-seconds>");
|
|
@@ -20,7 +19,7 @@ console.log(`
|
|
|
20
19
|
\u{1F525} [Blaze] Injecting load tests using Blaze metrics aggregation engine...
|
|
21
20
|
`);
|
|
22
21
|
try {
|
|
23
|
-
const metrics =
|
|
22
|
+
const metrics = runBlazeCore(targetScriptPath, vusCount, durationSeconds, csvOutputPath);
|
|
24
23
|
const actualDurationSec = (metrics.execution_duration_ms || 0) / 1e3;
|
|
25
24
|
const throughput = (metrics.total_requests / (actualDurationSec || 1)).toFixed(2);
|
|
26
25
|
const errorRate = (metrics.failed_requests / (metrics.total_requests || 1) * 100).toFixed(2);
|
|
Binary file
|