blaze-performance-tester 1.1.10 → 1.1.11
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 +10 -8
- package/dist/index.js +16 -2
- package/index.d.ts +0 -0
- package/index.js +16 -2
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
// cli.ts
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import { createRequire } from "node:module";
|
|
5
4
|
import { fileURLToPath } from "node:url";
|
|
6
5
|
var __filename = fileURLToPath(import.meta.url);
|
|
7
6
|
var __dirname = path.dirname(__filename);
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
7
|
+
var indexPath = path.resolve(__dirname, "../index.js");
|
|
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
|
+
}
|
|
11
15
|
var args = process.argv.slice(2);
|
|
12
16
|
if (args.length < 3) {
|
|
13
|
-
console.error("
|
|
14
|
-
console.error("Usage: \x1B[36mnpx blaze-performance-tester <script-path> <vus> <duration-seconds>\x1B[0m");
|
|
17
|
+
console.error("Usage: npx blaze-performance-tester <script-path> <vus> <duration-seconds>");
|
|
15
18
|
process.exit(1);
|
|
16
19
|
}
|
|
17
20
|
var targetScript = args[0];
|
|
@@ -53,7 +56,6 @@ try {
|
|
|
53
56
|
console.log(` \u2514\u2500\u2500 Maximum: ${(metrics.max_latency_ms ?? 0).toFixed(2)} ms`);
|
|
54
57
|
console.log(`=============================================================================`);
|
|
55
58
|
} catch (error) {
|
|
56
|
-
console.error("\n\x1B[31m\u{1F4A5} Critical Native Core Execution Error:\x1B[0m");
|
|
57
|
-
console.error(error);
|
|
59
|
+
console.error("\n\x1B[31m\u{1F4A5} Critical Native Core Execution Error:\x1B[0m", error);
|
|
58
60
|
process.exit(1);
|
|
59
61
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
import { createRequire } from 'module';
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
2
7
|
const require = createRequire(import.meta.url);
|
|
3
|
-
|
|
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
|
+
}
|
|
4
18
|
|
|
5
19
|
export const runBlazeCore = nativeBinding.runBlazeCore;
|
package/index.d.ts
ADDED
|
File without changes
|
package/index.js
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
import { createRequire } from 'module';
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
2
7
|
const require = createRequire(import.meta.url);
|
|
3
|
-
|
|
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
|
+
}
|
|
4
18
|
|
|
5
19
|
export const runBlazeCore = nativeBinding.runBlazeCore;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blaze-performance-tester",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.11",
|
|
4
4
|
"description": "A high-performance, multi-threaded load testing engine built with Rust and QuickJS.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"dist",
|
|
15
|
-
"bin.js",
|
|
16
15
|
"index.js",
|
|
16
|
+
"index.d.ts",
|
|
17
17
|
"blaze.win32-x64-msvc.node"
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|