sparkforensics 0.2.4

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Agustin Recoba
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # sparkforensics
2
+
3
+ Installs the `sparkforensics-analyze` command, which analyzes Apache Spark
4
+ event logs for performance bottlenecks. This package holds no analysis code:
5
+ it depends on [sparkforensics-cli](https://www.npmjs.com/package/sparkforensics-cli)
6
+ and runs its `sparkforensics-analyze` bin with the same arguments, output and
7
+ exit code.
8
+
9
+ ```bash
10
+ npm install -g sparkforensics
11
+ sparkforensics-analyze path/to/eventlog --max-runtime 3600000 --max-skew 3
12
+ ```
13
+
14
+ Or without installing: `npx sparkforensics path/to/eventlog`.
15
+
16
+ See the [main README](https://github.com/shuffle-works/sparkforensics#readme)
17
+ for the full flag reference and exit codes.
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+ // Alias bin: runs sparkforensics-cli's sparkforensics-analyze with the same
3
+ // arguments and stdio, and exits with its exit code (or re-raises its signal).
4
+ // packages/analyze and packages/sparkforensics ship this same file.
5
+ import { spawn } from 'node:child_process';
6
+ import { readFileSync } from 'node:fs';
7
+ import { createRequire } from 'node:module';
8
+ import { dirname, join } from 'node:path';
9
+
10
+ const require = createRequire(import.meta.url);
11
+ const cliManifestPath = require.resolve('sparkforensics-cli/package.json');
12
+ const cliManifest = JSON.parse(readFileSync(cliManifestPath, 'utf8'));
13
+ const cliBin = join(dirname(cliManifestPath), cliManifest.bin['sparkforensics-analyze']);
14
+
15
+ const child = spawn(process.execPath, [cliBin, ...process.argv.slice(2)], { stdio: 'inherit' });
16
+
17
+ // Ctrl-C already reaches the child through the terminal's process group; a
18
+ // signal sent to this process alone is passed on. Either way this process
19
+ // stays alive until the child exits, so it can report the child's status.
20
+ const forward = (signal) => child.kill(signal);
21
+ for (const signal of ['SIGINT', 'SIGTERM', 'SIGHUP']) process.on(signal, forward);
22
+
23
+ child.on('error', (err) => {
24
+ process.stderr.write(`sparkforensics-analyze: could not start sparkforensics-cli: ${err.message}\n`);
25
+ process.exitCode = 1;
26
+ });
27
+
28
+ child.on('exit', (code, signal) => {
29
+ if (signal) {
30
+ process.removeListener(signal, forward);
31
+ process.kill(process.pid, signal);
32
+ return;
33
+ }
34
+ process.exitCode = code;
35
+ });
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "sparkforensics",
3
+ "version": "0.2.4",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "description": "Installs the sparkforensics-analyze command from sparkforensics-cli: analyze Apache Spark event logs for skew, spill, GC pressure, stragglers, and more.",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/shuffle-works/sparkforensics.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/shuffle-works/sparkforensics/issues"
13
+ },
14
+ "homepage": "https://github.com/shuffle-works/sparkforensics#readme",
15
+ "keywords": [
16
+ "apache-spark",
17
+ "spark",
18
+ "spark-history-server",
19
+ "cli",
20
+ "performance",
21
+ "diagnostics",
22
+ "event-log"
23
+ ],
24
+ "bin": {
25
+ "sparkforensics-analyze": "bin/sparkforensics-analyze.mjs"
26
+ },
27
+ "engines": {
28
+ "node": ">=18"
29
+ },
30
+ "files": [
31
+ "bin/"
32
+ ],
33
+ "dependencies": {
34
+ "sparkforensics-cli": "^0.2.4"
35
+ }
36
+ }