blaze-performance-tester 1.1.12 → 1.1.14
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 +13 -32
- package/dist/index.js +4 -18
- package/index.js +4 -18
- package/index.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
// cli.ts
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
import { createRequire } from "module";
|
|
5
|
+
var require2 = createRequire(import.meta.url);
|
|
5
6
|
var __filename = fileURLToPath(import.meta.url);
|
|
6
7
|
var __dirname = path.dirname(__filename);
|
|
7
|
-
var
|
|
8
|
-
var nativeBinding;
|
|
9
|
-
if (fs.existsSync(indexPath)) {
|
|
10
|
-
nativeBinding = await import(`file://${indexPath}`);
|
|
11
|
-
} else {
|
|
12
|
-
console.error(`\x1B[31m\u274C Critical: Blaze entry module not found at ${indexPath}\x1B[0m`);
|
|
13
|
-
process.exit(1);
|
|
14
|
-
}
|
|
8
|
+
var nativeBinding = require2(path.resolve(__dirname, "../index.js"));
|
|
15
9
|
var args = process.argv.slice(2);
|
|
16
10
|
if (args.length < 3) {
|
|
17
11
|
console.error("Usage: npx blaze-performance-tester <script-path> <vus> <duration-seconds>");
|
|
@@ -21,16 +15,9 @@ var targetScript = args[0];
|
|
|
21
15
|
var vusCount = parseInt(args[1], 10);
|
|
22
16
|
var durationSeconds = parseInt(args[2], 10);
|
|
23
17
|
var targetScriptPath = path.resolve(process.cwd(), targetScript);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
var resultsFolder = path.join(process.cwd(), "results");
|
|
29
|
-
if (!fs.existsSync(resultsFolder)) {
|
|
30
|
-
fs.mkdirSync(resultsFolder, { recursive: true });
|
|
31
|
-
}
|
|
32
|
-
var csvOutputPath = path.join(resultsFolder, "summary_report.csv");
|
|
33
|
-
console.log(`\x1B[33m\u{1F525} [Blaze] Injecting load tests using Blaze metrics aggregation engine...\x1B[0m
|
|
18
|
+
var csvOutputPath = path.join(process.cwd(), "summary_report.csv");
|
|
19
|
+
console.log(`
|
|
20
|
+
\u{1F525} [Blaze] Injecting load tests using Blaze metrics aggregation engine...
|
|
34
21
|
`);
|
|
35
22
|
try {
|
|
36
23
|
const metrics = nativeBinding.runBlazeCore(targetScriptPath, vusCount, durationSeconds, csvOutputPath);
|
|
@@ -42,20 +29,14 @@ try {
|
|
|
42
29
|
console.log(` Active VUs: ${vusCount} parallel threads`);
|
|
43
30
|
console.log(` Elapsed Time: ${actualDurationSec.toFixed(2)} seconds`);
|
|
44
31
|
console.log(`-----------------------------------------------------------------------------`);
|
|
45
|
-
console.log(` Samples (Requests): ${metrics.total_requests
|
|
32
|
+
console.log(` Samples (Requests): ${metrics.total_requests}`);
|
|
46
33
|
console.log(` Throughput Rate: ${throughput} req/sec`);
|
|
47
|
-
console.log(` Error Rate: ${errorRate}% (${metrics.failed_requests
|
|
34
|
+
console.log(` Error Rate: ${errorRate}% (${metrics.failed_requests} failed)`);
|
|
48
35
|
console.log(`-----------------------------------------------------------------------------`);
|
|
49
36
|
console.log(`\u{1F4C8} Latency Statistics (ms):`);
|
|
50
|
-
console.log(` \u251C\u2500\u2500
|
|
51
|
-
console.log(` \
|
|
52
|
-
console.log(` \u251C\u2500\u2500 Median (50%): ${(metrics.p50_latency_ms ?? 0).toFixed(2)} ms`);
|
|
53
|
-
console.log(` \u251C\u2500\u2500 90th %ile: ${(metrics.p90_latency_ms ?? 0).toFixed(2)} ms`);
|
|
54
|
-
console.log(` \u251C\u2500\u2500 95th %ile: ${(metrics.p95_latency_ms ?? 0).toFixed(2)} ms`);
|
|
55
|
-
console.log(` \u251C\u2500\u2500 99th %ile: ${(metrics.p99_latency_ms ?? 0).toFixed(2)} ms`);
|
|
56
|
-
console.log(` \u2514\u2500\u2500 Maximum: ${(metrics.max_latency_ms ?? 0).toFixed(2)} ms`);
|
|
37
|
+
console.log(` \u251C\u2500\u2500 Average: ${metrics.avg_latency_ms.toFixed(2)} ms`);
|
|
38
|
+
console.log(` \u2514\u2500\u2500 Maximum: ${metrics.max_latency_ms.toFixed(2)} ms`);
|
|
57
39
|
console.log(`=============================================================================`);
|
|
58
40
|
} catch (error) {
|
|
59
|
-
console.error("
|
|
60
|
-
process.exit(1);
|
|
41
|
+
console.error("Execution error:", error);
|
|
61
42
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
1
|
+
const { runBlazeCore } = require('./blaze.win32-x64-msvc.node');
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// Force an absolute lookup path directly to the packaged location
|
|
10
|
-
const nativeBinaryPath = path.resolve(__dirname, './blaze.win32-x64-msvc.node');
|
|
11
|
-
|
|
12
|
-
let nativeBinding = null;
|
|
13
|
-
try {
|
|
14
|
-
nativeBinding = require(nativeBinaryPath);
|
|
15
|
-
} catch (e) {
|
|
16
|
-
throw new Error(`Blaze Engine failed to load native binary at ${nativeBinaryPath}. Internal Error: ${e.message}`);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const runBlazeCore = nativeBinding.runBlazeCore;
|
|
3
|
+
module.exports = {
|
|
4
|
+
runBlazeCore
|
|
5
|
+
};
|
package/index.js
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
1
|
+
const { runBlazeCore } = require('./blaze.win32-x64-msvc.node');
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// Force an absolute lookup path directly to the packaged location
|
|
10
|
-
const nativeBinaryPath = path.resolve(__dirname, './blaze.win32-x64-msvc.node');
|
|
11
|
-
|
|
12
|
-
let nativeBinding = null;
|
|
13
|
-
try {
|
|
14
|
-
nativeBinding = require(nativeBinaryPath);
|
|
15
|
-
} catch (e) {
|
|
16
|
-
throw new Error(`Blaze Engine failed to load native binary at ${nativeBinaryPath}. Internal Error: ${e.message}`);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const runBlazeCore = nativeBinding.runBlazeCore;
|
|
3
|
+
module.exports = {
|
|
4
|
+
runBlazeCore
|
|
5
|
+
};
|
|
Binary file
|