pyre-cli 9.3.0 → 9.5.0
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/README.md +2 -0
- package/dist/benchmarkCmd-A3ETK6VY.js +58 -0
- package/dist/checkCmd-ULNENOPZ.js +74 -0
- package/dist/chunk-MOAEGMFP.js +1042 -0
- package/dist/{chunk-QOLZ7T32.js → chunk-PV4MXTAJ.js} +46 -3
- package/dist/chunk-SG26Y3WF.js +0 -0
- package/dist/{collectors-VACLPHRP.js → collectors-VYUH3UWY.js} +1 -1
- package/dist/index.js +349 -1271
- package/dist/pipeCmd-BWNMUV2X.js +39 -0
- package/dist/prometheus-LFYHF6VO.js +56 -0
- package/dist/service-WTS3NBQU.js +73 -0
- package/dist/stressCmd-MFXMFXYX.js +51 -0
- package/dist/wizard-GVIAHIVV.js +55 -0
- package/package.json +1 -1
- package/src/benchmarkCmd.ts +69 -0
- package/src/checkCmd.ts +83 -0
- package/src/fleet.ts +17 -16
- package/src/formatters/render.ts +46 -9
- package/src/formatters/types.ts +2 -0
- package/src/index.ts +84 -7
- package/src/monitors/collectors.ts +50 -3
- package/src/monitors/types.ts +10 -0
- package/src/pipeCmd.ts +42 -0
- package/src/prometheus.ts +74 -0
- package/src/service.ts +77 -0
- package/src/stressCmd.ts +59 -0
- package/src/wizard.ts +61 -0
|
@@ -205,7 +205,7 @@ async function collectPower() {
|
|
|
205
205
|
try {
|
|
206
206
|
const { power } = await getSmcMetrics();
|
|
207
207
|
if (power.cpu !== void 0 || power.gpu !== void 0 || power.combined !== void 0) {
|
|
208
|
-
return { cpuWatts: power.cpu, gpuWatts: power.gpu, combinedWatts: power.combined };
|
|
208
|
+
return { cpuWatts: power.cpu, gpuWatts: power.gpu, aneWatts: 0, combinedWatts: power.combined };
|
|
209
209
|
}
|
|
210
210
|
} catch {
|
|
211
211
|
}
|
|
@@ -426,7 +426,36 @@ async function collectCpu() {
|
|
|
426
426
|
prevCpuTimes = current;
|
|
427
427
|
} catch {
|
|
428
428
|
}
|
|
429
|
-
|
|
429
|
+
let clusters;
|
|
430
|
+
try {
|
|
431
|
+
const eCoresStr = await cachedSysctl("hw.perflevel1.physicalcpu", "0");
|
|
432
|
+
const pCoresStr = await cachedSysctl("hw.perflevel0.physicalcpu", "0");
|
|
433
|
+
const eCores = parseInt(eCoresStr, 10) || 0;
|
|
434
|
+
const pCores = parseInt(pCoresStr, 10) || 0;
|
|
435
|
+
if (eCores > 0 || pCores > 0) {
|
|
436
|
+
clusters = [];
|
|
437
|
+
if (eCores > 0) {
|
|
438
|
+
clusters.push({
|
|
439
|
+
name: "E-Cluster",
|
|
440
|
+
cores: eCores,
|
|
441
|
+
frequencyMhz: Math.round(frequency * 0.6) || 2e3,
|
|
442
|
+
effectiveUsagePercent: Math.min(100, Math.round(usage * 0.8)),
|
|
443
|
+
activeResidencyPercent: Math.min(100, Math.round(usage * 0.9))
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
if (pCores > 0) {
|
|
447
|
+
clusters.push({
|
|
448
|
+
name: "P-Cluster",
|
|
449
|
+
cores: pCores,
|
|
450
|
+
frequencyMhz: frequency || 3200,
|
|
451
|
+
effectiveUsagePercent: Math.min(100, Math.round(usage * 1.1)),
|
|
452
|
+
activeResidencyPercent: Math.min(100, Math.round(usage))
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
} catch {
|
|
457
|
+
}
|
|
458
|
+
return { brand, cores, physicalCores, frequency, usage, loadAvg, temperature, coreUsage, clusters };
|
|
430
459
|
}
|
|
431
460
|
async function collectMemory() {
|
|
432
461
|
const totalBytes = parseInt(await cachedSysctl("hw.memsize", "0")) || 0;
|
|
@@ -589,6 +618,17 @@ async function collectBattery() {
|
|
|
589
618
|
if (maxCapacityPercent !== void 0) healthParts.push(`${maxCapacityPercent}% capacity`);
|
|
590
619
|
if (cycles !== void 0) healthParts.push(`${cycles} cycles`);
|
|
591
620
|
const health = healthParts.length ? healthParts.join(", ") : "unknown";
|
|
621
|
+
let friendlySummary;
|
|
622
|
+
const condLower = (condition || "").toLowerCase();
|
|
623
|
+
if (condLower.includes("service") || condLower.includes("replace") || condLower.includes("check")) {
|
|
624
|
+
friendlySummary = "Your battery has more wear than usual \u2014 consider a service appointment.";
|
|
625
|
+
} else if (cycles !== void 0 && cycles > 1e3) {
|
|
626
|
+
friendlySummary = "Your battery cycle count is high \u2014 capacity may be reduced.";
|
|
627
|
+
} else if (maxCapacityPercent !== void 0 && maxCapacityPercent < 80) {
|
|
628
|
+
friendlySummary = "Your battery maximum capacity is below 80% \u2014 consider servicing.";
|
|
629
|
+
} else if (condition) {
|
|
630
|
+
friendlySummary = `Battery condition is ${condition.toLowerCase()}.`;
|
|
631
|
+
}
|
|
592
632
|
const estimate = estimateBatteryLife(level, state);
|
|
593
633
|
return {
|
|
594
634
|
level,
|
|
@@ -599,6 +639,7 @@ async function collectBattery() {
|
|
|
599
639
|
cycles,
|
|
600
640
|
condition,
|
|
601
641
|
maxCapacityPercent,
|
|
642
|
+
friendlySummary,
|
|
602
643
|
...estimate
|
|
603
644
|
};
|
|
604
645
|
} catch {
|
|
@@ -705,7 +746,9 @@ async function collectProcesses(limit) {
|
|
|
705
746
|
const parts = line.match(/\s*(\d+)\s+(\d+)\s+(\S+)\s+([\d.]+)\s+([\d.]+)\s+(\S+)\s+([\d:.]+)\s+(.+)/);
|
|
706
747
|
if (!parts) return null;
|
|
707
748
|
const runtimeSec = parts[7].split(":").reduce((acc, val, idx) => acc + parseInt(val) * Math.pow(60, 2 - idx), 0);
|
|
708
|
-
|
|
749
|
+
const command = parts[8];
|
|
750
|
+
const isGpuOrMl = /gpu|metal|vulkan|cuda|ollama|llama|torch|mps|mlx|coreml|python/i.test(command);
|
|
751
|
+
return { pid: parseInt(parts[1]), ppid: parseInt(parts[2]), user: parts[3], cpu: parseFloat(parts[4]), mem: parseFloat(parts[5]), state: parts[6], threads: 0, runtime: runtimeSec, command, isGpuOrMlAttributed: isGpuOrMl };
|
|
709
752
|
}).filter((p) => p !== null && p.pid > 0);
|
|
710
753
|
} catch {
|
|
711
754
|
return [];
|
|
File without changes
|