@coana-tech/cli 14.12.145 → 14.12.147
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/cli.mjs +500 -330
- package/package.json +1 -1
- package/reachability-analyzers-cli.mjs +374 -240
- package/repos/coana-tech/goana/bin/goana-darwin-amd64.gz +0 -0
- package/repos/coana-tech/goana/bin/goana-darwin-arm64.gz +0 -0
- package/repos/coana-tech/goana/bin/goana-linux-amd64.gz +0 -0
- package/repos/coana-tech/goana/bin/goana-linux-arm64.gz +0 -0
- package/repos/coana-tech/javap-service/javap-service.jar +0 -0
- package/repos/coana-tech/jelly-private/dist/bundle/jelly.js +90 -2
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -46,6 +46,7 @@ var require_timer = __commonJS({
|
|
|
46
46
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
47
|
exports.TimeoutException = void 0;
|
|
48
48
|
exports.nanoToMs = nanoToMs;
|
|
49
|
+
exports.nanoToMsNumber = nanoToMsNumber;
|
|
49
50
|
var options_1 = require_options();
|
|
50
51
|
var hrtime = process.hrtime;
|
|
51
52
|
var Timer = class {
|
|
@@ -78,6 +79,10 @@ var require_timer = __commonJS({
|
|
|
78
79
|
return `${n / 1000000n}ms`;
|
|
79
80
|
}
|
|
80
81
|
__name(nanoToMs, "nanoToMs");
|
|
82
|
+
function nanoToMsNumber(n) {
|
|
83
|
+
return Number(n / 1000000n);
|
|
84
|
+
}
|
|
85
|
+
__name(nanoToMsNumber, "nanoToMsNumber");
|
|
81
86
|
}
|
|
82
87
|
});
|
|
83
88
|
|
|
@@ -1956,6 +1961,49 @@ var require_scc = __commonJS({
|
|
|
1956
1961
|
}
|
|
1957
1962
|
});
|
|
1958
1963
|
|
|
1964
|
+
// lib/misc/telemetry-emitter.js
|
|
1965
|
+
var require_telemetry_emitter = __commonJS({
|
|
1966
|
+
"lib/misc/telemetry-emitter.js"(exports) {
|
|
1967
|
+
"use strict";
|
|
1968
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1969
|
+
exports.telemetryEmitter = void 0;
|
|
1970
|
+
var fs_1 = __require("fs");
|
|
1971
|
+
var filePath = process.env.ANALYZER_TELEMETRY_FILE_PATH;
|
|
1972
|
+
function emit(eventType, data = {}) {
|
|
1973
|
+
if (!filePath)
|
|
1974
|
+
return;
|
|
1975
|
+
const event = JSON.stringify({
|
|
1976
|
+
data: {
|
|
1977
|
+
type: eventType,
|
|
1978
|
+
...data
|
|
1979
|
+
}
|
|
1980
|
+
}) + "\n";
|
|
1981
|
+
try {
|
|
1982
|
+
(0, fs_1.appendFileSync)(filePath, event);
|
|
1983
|
+
} catch (err) {
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
__name(emit, "emit");
|
|
1987
|
+
function phaseStarted(phase, metadata = {}) {
|
|
1988
|
+
emit("phase.started", { phase, ...metadata });
|
|
1989
|
+
}
|
|
1990
|
+
__name(phaseStarted, "phaseStarted");
|
|
1991
|
+
function phaseCompleted(phase, durationMs, metadata = {}) {
|
|
1992
|
+
emit("phase.completed", { phase, durationMs, ...metadata });
|
|
1993
|
+
}
|
|
1994
|
+
__name(phaseCompleted, "phaseCompleted");
|
|
1995
|
+
function diagnostics(metadata = {}) {
|
|
1996
|
+
emit("diagnostics", metadata);
|
|
1997
|
+
}
|
|
1998
|
+
__name(diagnostics, "diagnostics");
|
|
1999
|
+
exports.telemetryEmitter = {
|
|
2000
|
+
phaseStarted,
|
|
2001
|
+
phaseCompleted,
|
|
2002
|
+
diagnostics
|
|
2003
|
+
};
|
|
2004
|
+
}
|
|
2005
|
+
});
|
|
2006
|
+
|
|
1959
2007
|
// lib/misc/memory.js
|
|
1960
2008
|
var require_memory = __commonJS({
|
|
1961
2009
|
"lib/misc/memory.js"(exports) {
|
|
@@ -2092,6 +2140,7 @@ var require_diagnostics = __commonJS({
|
|
|
2092
2140
|
analyzerRounds = 0;
|
|
2093
2141
|
listenerNotificationRounds = 0;
|
|
2094
2142
|
lastPrintDiagnosticsTime = 0;
|
|
2143
|
+
lastTelemetryTime = 0;
|
|
2095
2144
|
tokenListenerNotifications = 0;
|
|
2096
2145
|
tokenListener2Notifications = 0;
|
|
2097
2146
|
arrayEntriesListenerNotifications = 0;
|
|
@@ -2403,6 +2452,7 @@ var require_solver = __commonJS({
|
|
|
2403
2452
|
var scc_1 = require_scc();
|
|
2404
2453
|
var options_1 = require_options();
|
|
2405
2454
|
var timer_1 = __importStar(require_timer());
|
|
2455
|
+
var telemetry_emitter_1 = require_telemetry_emitter();
|
|
2406
2456
|
var promises_1 = __require("timers/promises");
|
|
2407
2457
|
var memory_1 = require_memory();
|
|
2408
2458
|
var diagnostics_1 = __importDefault(require_diagnostics());
|
|
@@ -2571,12 +2621,38 @@ var require_solver = __commonJS({
|
|
|
2571
2621
|
}
|
|
2572
2622
|
}
|
|
2573
2623
|
}
|
|
2624
|
+
emitDiagnosticsTelemetry() {
|
|
2625
|
+
const { globalState: a, fragmentState: f, diagnostics: d } = this;
|
|
2626
|
+
telemetry_emitter_1.telemetryEmitter.diagnostics({
|
|
2627
|
+
memory: (0, memory_1.getMemoryUsage)() * 1048576,
|
|
2628
|
+
phase: this.phase,
|
|
2629
|
+
callEdges: f.numberOfCallToFunctionEdges,
|
|
2630
|
+
vars: f.getNumberOfVarsWithTokens(),
|
|
2631
|
+
tokens: f.numberOfTokens,
|
|
2632
|
+
subsetEdges: f.numberOfSubsetEdges,
|
|
2633
|
+
round: d.round,
|
|
2634
|
+
wave: d.wave,
|
|
2635
|
+
propagations: d.propagations,
|
|
2636
|
+
unprocessedVars: this.unprocessedTokens.size,
|
|
2637
|
+
unprocessedTokensSize: d.unprocessedTokensSize,
|
|
2638
|
+
unprocessedListeners1: f.postponedListenerCalls.length,
|
|
2639
|
+
unprocessedListeners2: f.postponedListenerCalls2.length,
|
|
2640
|
+
packages: a.packageInfos.size,
|
|
2641
|
+
modules: a.moduleInfos.size,
|
|
2642
|
+
functions: a.functionInfos.size,
|
|
2643
|
+
uniqueTokens: a.canonicalTokens.size
|
|
2644
|
+
});
|
|
2645
|
+
}
|
|
2574
2646
|
printDiagnostics() {
|
|
2647
|
+
const d = Number(this.timer.elapsed() / 1000000n);
|
|
2648
|
+
const f = this.fragmentState;
|
|
2649
|
+
if (d > this.diagnostics.lastTelemetryTime + 3e3) {
|
|
2650
|
+
this.diagnostics.lastTelemetryTime = d;
|
|
2651
|
+
this.emitDiagnosticsTelemetry();
|
|
2652
|
+
}
|
|
2575
2653
|
if (options_1.options.printProgress && options_1.options.tty && logger_1.isTTY && !options_1.options.logfile && logger_1.default.level === "info") {
|
|
2576
|
-
const d = Number(this.timer.elapsed() / 1000000n);
|
|
2577
2654
|
if (d > this.diagnostics.lastPrintDiagnosticsTime + 100) {
|
|
2578
2655
|
this.diagnostics.lastPrintDiagnosticsTime = d;
|
|
2579
|
-
const f = this.fragmentState;
|
|
2580
2656
|
(0, logger_1.writeStdOut)(`${this.phase}... (total time: ${d}ms, call edges: ${f.numberOfCallToFunctionEdges}` + (options_1.options.diagnostics ? `, vars: ${f.getNumberOfVarsWithTokens()}, tokens: ${f.numberOfTokens}, subsets: ${f.numberOfSubsetEdges}, ` + (options_1.options.maxIndirections !== void 0 ? `round: ${this.diagnostics.round}, ` : "") + `wave: ${this.diagnostics.wave}, propagations: ${this.diagnostics.propagations}, worklist: ${this.diagnostics.unprocessedTokensSize + f.postponedListenerCalls.length + f.postponedListenerCalls2.length - this.postponedListenersProcessed}` : "") + ")");
|
|
2581
2657
|
f.a.timeoutTimer.checkTimeout();
|
|
2582
2658
|
(0, memory_1.checkMemoryLow)();
|
|
@@ -5231,11 +5307,14 @@ var require_analyzer = __commonJS({
|
|
|
5231
5307
|
var tokens_1 = require_tokens();
|
|
5232
5308
|
var types_1 = __require("@babel/types");
|
|
5233
5309
|
var memory_1 = require_memory();
|
|
5310
|
+
var telemetry_emitter_1 = require_telemetry_emitter();
|
|
5234
5311
|
async function analyzeFiles(files, solver) {
|
|
5235
5312
|
const a = solver.globalState;
|
|
5236
5313
|
const d = solver.diagnostics;
|
|
5237
5314
|
const timer = new timer_1.default();
|
|
5238
5315
|
(0, options_1.resolveBaseDir)();
|
|
5316
|
+
telemetry_emitter_1.telemetryEmitter.phaseStarted("analysis", { fileCount: files.length });
|
|
5317
|
+
solver.emitDiagnosticsTelemetry();
|
|
5239
5318
|
if (options_1.options.approx || options_1.options.approxLoad) {
|
|
5240
5319
|
a.approx = new processmanager_1.ProcessManager(a);
|
|
5241
5320
|
a.patching = new patching_1.Patching(a.approx.hints);
|
|
@@ -5492,9 +5571,18 @@ var require_analyzer = __commonJS({
|
|
|
5492
5571
|
logger_1.default.warn("Warning: Wave limit reached, analysis terminated early");
|
|
5493
5572
|
else if (d.indirectionsLimitReached > 0)
|
|
5494
5573
|
logger_1.default.warn("Warning: Indirection limit reached, analysis terminated early");
|
|
5574
|
+
telemetry_emitter_1.telemetryEmitter.phaseStarted("finalization");
|
|
5495
5575
|
(0, finalization_1.finalizeCallEdges)(solver);
|
|
5496
5576
|
solver.updateDiagnostics();
|
|
5577
|
+
telemetry_emitter_1.telemetryEmitter.phaseCompleted("finalization", (0, timer_1.nanoToMsNumber)(d.finalizationTime));
|
|
5578
|
+
solver.emitDiagnosticsTelemetry();
|
|
5497
5579
|
d.analysisTime = timer.elapsed();
|
|
5580
|
+
telemetry_emitter_1.telemetryEmitter.phaseCompleted("analysis", (0, timer_1.nanoToMsNumber)(d.analysisTime), {
|
|
5581
|
+
packages: d.packages,
|
|
5582
|
+
modules: d.modules,
|
|
5583
|
+
timeout: d.timeout,
|
|
5584
|
+
aborted: d.aborted
|
|
5585
|
+
});
|
|
5498
5586
|
d.errors = (0, util_1.getMapHybridSetSize)(solver.fragmentState.errors) + a.filesWithParseErrors.length;
|
|
5499
5587
|
d.warnings = (0, util_1.getMapHybridSetSize)(solver.fragmentState.warnings) + (0, util_1.getMapHybridSetSize)(solver.fragmentState.warningsUnsupported);
|
|
5500
5588
|
if (!options_1.options.modulesOnly && files.length > 0) {
|