@appkit/llamacpp-cli 1.4.1 → 1.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/CHANGELOG.md +8 -0
- package/README.md +87 -1
- package/dist/cli.js +14 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/monitor.d.ts +2 -0
- package/dist/commands/monitor.d.ts.map +1 -0
- package/dist/commands/monitor.js +76 -0
- package/dist/commands/monitor.js.map +1 -0
- package/dist/lib/metrics-aggregator.d.ts +39 -0
- package/dist/lib/metrics-aggregator.d.ts.map +1 -0
- package/dist/lib/metrics-aggregator.js +200 -0
- package/dist/lib/metrics-aggregator.js.map +1 -0
- package/dist/lib/system-collector.d.ts +75 -0
- package/dist/lib/system-collector.d.ts.map +1 -0
- package/dist/lib/system-collector.js +310 -0
- package/dist/lib/system-collector.js.map +1 -0
- package/dist/tui/MonitorApp.d.ts +4 -0
- package/dist/tui/MonitorApp.d.ts.map +1 -0
- package/dist/tui/MonitorApp.js +293 -0
- package/dist/tui/MonitorApp.js.map +1 -0
- package/dist/tui/MultiServerMonitorApp.d.ts +4 -0
- package/dist/tui/MultiServerMonitorApp.d.ts.map +1 -0
- package/dist/tui/MultiServerMonitorApp.js +496 -0
- package/dist/tui/MultiServerMonitorApp.js.map +1 -0
- package/dist/tui/components/ErrorState.d.ts +8 -0
- package/dist/tui/components/ErrorState.d.ts.map +1 -0
- package/dist/tui/components/ErrorState.js +22 -0
- package/dist/tui/components/ErrorState.js.map +1 -0
- package/dist/tui/components/LoadingState.d.ts +8 -0
- package/dist/tui/components/LoadingState.d.ts.map +1 -0
- package/dist/tui/components/LoadingState.js +21 -0
- package/dist/tui/components/LoadingState.js.map +1 -0
- package/dist/types/monitor-types.d.ts +122 -0
- package/dist/types/monitor-types.d.ts.map +1 -0
- package/dist/types/monitor-types.js +3 -0
- package/dist/types/monitor-types.js.map +1 -0
- package/dist/utils/process-utils.d.ts +16 -1
- package/dist/utils/process-utils.d.ts.map +1 -1
- package/dist/utils/process-utils.js +144 -27
- package/dist/utils/process-utils.js.map +1 -1
- package/package.json +3 -1
- package/src/cli.ts +14 -0
- package/src/commands/monitor.ts +90 -0
- package/src/lib/metrics-aggregator.ts +244 -0
- package/src/lib/system-collector.ts +312 -0
- package/src/tui/MonitorApp.ts +361 -0
- package/src/tui/MultiServerMonitorApp.ts +547 -0
- package/src/types/monitor-types.ts +161 -0
- package/src/utils/process-utils.ts +160 -26
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.systemCollector = exports.SystemCollector = void 0;
|
|
37
|
+
const process_utils_js_1 = require("../utils/process-utils.js");
|
|
38
|
+
/**
|
|
39
|
+
* System metrics collector using macmon (optional) and vm_stat (fallback)
|
|
40
|
+
* Provides GPU, CPU, ANE, and memory metrics on macOS
|
|
41
|
+
*/
|
|
42
|
+
class SystemCollector {
|
|
43
|
+
constructor(macmonPath = '/opt/homebrew/bin/macmon') {
|
|
44
|
+
this.macmonAvailable = null;
|
|
45
|
+
this.lastSystemMetrics = null;
|
|
46
|
+
this.lastCollectionTime = 0;
|
|
47
|
+
this.CACHE_TTL_MS = 4000; // Cache for 4 seconds (longer than macmon spawn time)
|
|
48
|
+
this.collectingLock = null;
|
|
49
|
+
this.pCoreCount = 0;
|
|
50
|
+
this.eCoreCount = 0;
|
|
51
|
+
this.totalCores = 0;
|
|
52
|
+
this.macmonPath = macmonPath;
|
|
53
|
+
this.initializeCoreCount();
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get CPU core counts for weighted average calculation
|
|
57
|
+
*/
|
|
58
|
+
async initializeCoreCount() {
|
|
59
|
+
try {
|
|
60
|
+
const { execCommand } = await Promise.resolve().then(() => __importStar(require('../utils/process-utils.js')));
|
|
61
|
+
// Try to get P-core and E-core counts separately (Apple Silicon)
|
|
62
|
+
try {
|
|
63
|
+
const pCores = await execCommand('sysctl -n hw.perflevel0.physicalcpu 2>/dev/null');
|
|
64
|
+
const eCores = await execCommand('sysctl -n hw.perflevel1.physicalcpu 2>/dev/null');
|
|
65
|
+
this.pCoreCount = parseInt(pCores, 10) || 0;
|
|
66
|
+
this.eCoreCount = parseInt(eCores, 10) || 0;
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
// Fall back to total core count if perflevel not available
|
|
70
|
+
const total = await execCommand('sysctl -n hw.ncpu 2>/dev/null');
|
|
71
|
+
this.totalCores = parseInt(total, 10) || 0;
|
|
72
|
+
// Assume equal split if we can't get individual counts
|
|
73
|
+
this.pCoreCount = Math.floor(this.totalCores / 2);
|
|
74
|
+
this.eCoreCount = this.totalCores - this.pCoreCount;
|
|
75
|
+
}
|
|
76
|
+
this.totalCores = this.pCoreCount + this.eCoreCount;
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
// Default to 8 cores if we can't detect
|
|
80
|
+
this.pCoreCount = 4;
|
|
81
|
+
this.eCoreCount = 4;
|
|
82
|
+
this.totalCores = 8;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Check if macmon is available
|
|
87
|
+
*/
|
|
88
|
+
async checkMacmonAvailability() {
|
|
89
|
+
if (this.macmonAvailable !== null) {
|
|
90
|
+
return this.macmonAvailable;
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
const result = await (0, process_utils_js_1.execCommand)(`which ${this.macmonPath} 2>/dev/null`);
|
|
94
|
+
this.macmonAvailable = result.length > 0;
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
this.macmonAvailable = false;
|
|
98
|
+
}
|
|
99
|
+
return this.macmonAvailable;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Parse macmon JSON output
|
|
103
|
+
* Expected format from 'macmon pipe':
|
|
104
|
+
* {
|
|
105
|
+
* "gpu_usage": [count, percentage],
|
|
106
|
+
* "pcpu_usage": [count, percentage],
|
|
107
|
+
* "ecpu_usage": [count, percentage],
|
|
108
|
+
* "ane_power": number,
|
|
109
|
+
* "temp": {"cpu_temp_avg": number, "gpu_temp_avg": number}
|
|
110
|
+
* }
|
|
111
|
+
*/
|
|
112
|
+
parseMacmonJson(jsonLine) {
|
|
113
|
+
try {
|
|
114
|
+
const data = JSON.parse(jsonLine);
|
|
115
|
+
// GPU usage (second element of array, convert decimal to percentage)
|
|
116
|
+
const gpuUsage = data.gpu_usage?.[1] !== undefined
|
|
117
|
+
? data.gpu_usage[1] * 100
|
|
118
|
+
: undefined;
|
|
119
|
+
// CPU usage (weighted average of P-cores and E-cores)
|
|
120
|
+
// Each core type reports 0.0-1.0 utilization
|
|
121
|
+
// Calculate weighted average: (P% * Pcount + E% * Ecount) / totalCores
|
|
122
|
+
const pcpuUsage = data.pcpu_usage?.[1] || 0; // 0.0-1.0
|
|
123
|
+
const ecpuUsage = data.ecpu_usage?.[1] || 0; // 0.0-1.0
|
|
124
|
+
let cpuUsage;
|
|
125
|
+
if (this.totalCores > 0) {
|
|
126
|
+
// Weighted average normalized to 0-100%
|
|
127
|
+
cpuUsage = ((pcpuUsage * this.pCoreCount) + (ecpuUsage * this.eCoreCount)) / this.totalCores * 100;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
// Fallback: simple average if core counts not available
|
|
131
|
+
cpuUsage = ((pcpuUsage + ecpuUsage) / 2) * 100;
|
|
132
|
+
}
|
|
133
|
+
// ANE usage (estimate from power draw - macmon doesn't provide usage %)
|
|
134
|
+
// If ANE power > 0.1W, consider it active (rough estimate)
|
|
135
|
+
const aneUsage = data.ane_power > 0.1
|
|
136
|
+
? Math.min((data.ane_power / 8.0) * 100, 100) // Assume ~8W max for ANE
|
|
137
|
+
: 0;
|
|
138
|
+
// Temperature (use GPU temp if available, otherwise CPU)
|
|
139
|
+
const temperature = data.temp?.gpu_temp_avg || data.temp?.cpu_temp_avg;
|
|
140
|
+
return {
|
|
141
|
+
gpuUsage,
|
|
142
|
+
cpuUsage: cpuUsage > 0 ? cpuUsage : undefined,
|
|
143
|
+
aneUsage: aneUsage > 1 ? aneUsage : undefined,
|
|
144
|
+
temperature,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
return {};
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Collect macmon metrics (GPU, CPU, ANE)
|
|
153
|
+
* Uses 'macmon pipe' which outputs one JSON line per update
|
|
154
|
+
* Spawns macmon, reads one line, and kills it to prevent process leaks
|
|
155
|
+
*/
|
|
156
|
+
async getMacmonMetrics() {
|
|
157
|
+
const available = await this.checkMacmonAvailability();
|
|
158
|
+
if (!available) {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
try {
|
|
162
|
+
// Spawn macmon pipe, read one line, and kill it
|
|
163
|
+
// This prevents orphaned macmon processes
|
|
164
|
+
// Timeout set to 5s because macmon can take 3-4s to produce first line
|
|
165
|
+
const output = await (0, process_utils_js_1.spawnAndReadOneLine)(this.macmonPath, ['pipe'], 5000);
|
|
166
|
+
if (!output) {
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
return this.parseMacmonJson(output);
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Parse vm_stat output for memory metrics
|
|
177
|
+
* Expected format:
|
|
178
|
+
* Pages free: 123456.
|
|
179
|
+
* Pages active: 234567.
|
|
180
|
+
* Pages inactive: 345678.
|
|
181
|
+
* Pages speculative: 45678.
|
|
182
|
+
* Pages throttled: 0.
|
|
183
|
+
* Pages wired down: 123456.
|
|
184
|
+
* Pages purgeable count: 0.
|
|
185
|
+
* "Translation faults": 12345678.
|
|
186
|
+
* Pages copy-on-write: 123456.
|
|
187
|
+
* ...
|
|
188
|
+
*/
|
|
189
|
+
parseVmStatOutput(output) {
|
|
190
|
+
const lines = output.split('\n');
|
|
191
|
+
const pageSize = 16384; // 16KB on Apple Silicon
|
|
192
|
+
let pagesActive = 0;
|
|
193
|
+
let pagesWired = 0;
|
|
194
|
+
let pagesCompressed = 0;
|
|
195
|
+
let pagesFree = 0;
|
|
196
|
+
let pagesInactive = 0;
|
|
197
|
+
let pagesSpeculative = 0;
|
|
198
|
+
for (const line of lines) {
|
|
199
|
+
const match = line.match(/Pages (.*?):\s+(\d+)\./);
|
|
200
|
+
if (match) {
|
|
201
|
+
const name = match[1].toLowerCase();
|
|
202
|
+
const value = parseInt(match[2], 10);
|
|
203
|
+
if (name === 'active')
|
|
204
|
+
pagesActive = value;
|
|
205
|
+
else if (name === 'wired down')
|
|
206
|
+
pagesWired = value;
|
|
207
|
+
else if (name === 'compressed')
|
|
208
|
+
pagesCompressed = value;
|
|
209
|
+
else if (name === 'free')
|
|
210
|
+
pagesFree = value;
|
|
211
|
+
else if (name === 'inactive')
|
|
212
|
+
pagesInactive = value;
|
|
213
|
+
else if (name === 'speculative')
|
|
214
|
+
pagesSpeculative = value;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
// Calculate used memory (active + wired + compressed)
|
|
218
|
+
const usedPages = pagesActive + pagesWired + pagesCompressed;
|
|
219
|
+
const memoryUsed = usedPages * pageSize;
|
|
220
|
+
// Calculate total memory (used + free + inactive + speculative)
|
|
221
|
+
const totalPages = pagesActive +
|
|
222
|
+
pagesWired +
|
|
223
|
+
pagesCompressed +
|
|
224
|
+
pagesFree +
|
|
225
|
+
pagesInactive +
|
|
226
|
+
pagesSpeculative;
|
|
227
|
+
const memoryTotal = totalPages * pageSize;
|
|
228
|
+
return { memoryUsed, memoryTotal };
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Collect vm_stat memory metrics
|
|
232
|
+
*/
|
|
233
|
+
async getVmStatMetrics() {
|
|
234
|
+
try {
|
|
235
|
+
const output = await (0, process_utils_js_1.execCommand)('vm_stat 2>/dev/null');
|
|
236
|
+
return this.parseVmStatOutput(output);
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
// Fallback to zeros if vm_stat fails
|
|
240
|
+
return { memoryUsed: 0, memoryTotal: 0 };
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Collect all system metrics
|
|
245
|
+
* Attempts macmon first (GPU/CPU/ANE + memory), falls back to vm_stat (memory only)
|
|
246
|
+
* Caches results for 1.5s to prevent spawning multiple macmon processes
|
|
247
|
+
*/
|
|
248
|
+
async collectSystemMetrics() {
|
|
249
|
+
const now = Date.now();
|
|
250
|
+
// Return cached data if still fresh
|
|
251
|
+
if (this.lastSystemMetrics && (now - this.lastCollectionTime) < this.CACHE_TTL_MS) {
|
|
252
|
+
return this.lastSystemMetrics;
|
|
253
|
+
}
|
|
254
|
+
// If already collecting, wait for that to finish
|
|
255
|
+
if (this.collectingLock) {
|
|
256
|
+
return this.collectingLock;
|
|
257
|
+
}
|
|
258
|
+
// Start fresh collection
|
|
259
|
+
this.collectingLock = this.doCollectSystemMetrics();
|
|
260
|
+
try {
|
|
261
|
+
const metrics = await this.collectingLock;
|
|
262
|
+
this.lastSystemMetrics = metrics;
|
|
263
|
+
this.lastCollectionTime = now;
|
|
264
|
+
return metrics;
|
|
265
|
+
}
|
|
266
|
+
finally {
|
|
267
|
+
this.collectingLock = null;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Internal method to actually collect system metrics
|
|
272
|
+
* Called by collectSystemMetrics with caching/locking
|
|
273
|
+
*/
|
|
274
|
+
async doCollectSystemMetrics() {
|
|
275
|
+
const warnings = [];
|
|
276
|
+
const now = Date.now();
|
|
277
|
+
// Try macmon first
|
|
278
|
+
const macmonMetrics = await this.getMacmonMetrics();
|
|
279
|
+
// Always get memory from vm_stat (more reliable than macmon)
|
|
280
|
+
const memoryMetrics = await this.getVmStatMetrics();
|
|
281
|
+
// Determine source and add warnings
|
|
282
|
+
let source;
|
|
283
|
+
if (macmonMetrics) {
|
|
284
|
+
source = 'macmon';
|
|
285
|
+
}
|
|
286
|
+
else if (memoryMetrics.memoryTotal > 0) {
|
|
287
|
+
source = 'vm_stat';
|
|
288
|
+
warnings.push('macmon not available - showing memory metrics only');
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
source = 'none';
|
|
292
|
+
warnings.push('Unable to collect system metrics');
|
|
293
|
+
}
|
|
294
|
+
return {
|
|
295
|
+
gpuUsage: macmonMetrics?.gpuUsage,
|
|
296
|
+
cpuUsage: macmonMetrics?.cpuUsage,
|
|
297
|
+
aneUsage: macmonMetrics?.aneUsage,
|
|
298
|
+
temperature: macmonMetrics?.temperature,
|
|
299
|
+
memoryUsed: memoryMetrics.memoryUsed,
|
|
300
|
+
memoryTotal: memoryMetrics.memoryTotal,
|
|
301
|
+
timestamp: now,
|
|
302
|
+
source,
|
|
303
|
+
warnings: warnings.length > 0 ? warnings : undefined,
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
exports.SystemCollector = SystemCollector;
|
|
308
|
+
// Export singleton instance
|
|
309
|
+
exports.systemCollector = new SystemCollector();
|
|
310
|
+
//# sourceMappingURL=system-collector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-collector.js","sourceRoot":"","sources":["../../src/lib/system-collector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAA6E;AAG7E;;;GAGG;AACH,MAAa,eAAe;IAW1B,YAAY,aAAqB,0BAA0B;QATnD,oBAAe,GAAmB,IAAI,CAAC;QACvC,sBAAiB,GAAyB,IAAI,CAAC;QAC/C,uBAAkB,GAAW,CAAC,CAAC;QACtB,iBAAY,GAAG,IAAI,CAAC,CAAC,sDAAsD;QACpF,mBAAc,GAAkC,IAAI,CAAC;QACrD,eAAU,GAAW,CAAC,CAAC;QACvB,eAAU,GAAW,CAAC,CAAC;QACvB,eAAU,GAAW,CAAC,CAAC;QAG7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC7B,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,mBAAmB;QAC/B,IAAI,CAAC;YACH,MAAM,EA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src/tui/MonitorApp.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAIzD,wBAAsB,eAAe,CACnC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,EAC9B,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC,CAgWf"}
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createMonitorUI = createMonitorUI;
|
|
7
|
+
const blessed_1 = __importDefault(require("blessed"));
|
|
8
|
+
const metrics_aggregator_js_1 = require("../lib/metrics-aggregator.js");
|
|
9
|
+
async function createMonitorUI(screen, server) {
|
|
10
|
+
let updateInterval = 2000;
|
|
11
|
+
let intervalId = null;
|
|
12
|
+
let consecutiveFailures = 0;
|
|
13
|
+
let lastGoodData = null;
|
|
14
|
+
const STALE_THRESHOLD = 5;
|
|
15
|
+
const metricsAggregator = new metrics_aggregator_js_1.MetricsAggregator(server);
|
|
16
|
+
// Single scrollable content box
|
|
17
|
+
const contentBox = blessed_1.default.box({
|
|
18
|
+
top: 0,
|
|
19
|
+
left: 0,
|
|
20
|
+
width: '100%',
|
|
21
|
+
height: '100%',
|
|
22
|
+
tags: true,
|
|
23
|
+
scrollable: true,
|
|
24
|
+
alwaysScroll: true,
|
|
25
|
+
keys: true,
|
|
26
|
+
vi: true,
|
|
27
|
+
mouse: true,
|
|
28
|
+
scrollbar: {
|
|
29
|
+
ch: '█',
|
|
30
|
+
style: {
|
|
31
|
+
fg: 'blue',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
screen.append(contentBox);
|
|
36
|
+
// Helper to create progress bar
|
|
37
|
+
function createProgressBar(percentage, width = 30) {
|
|
38
|
+
const filled = Math.round((percentage / 100) * width);
|
|
39
|
+
const empty = width - filled;
|
|
40
|
+
return '[' + '█'.repeat(Math.max(0, filled)) + '░'.repeat(Math.max(0, empty)) + ']';
|
|
41
|
+
}
|
|
42
|
+
// Fetch and update display
|
|
43
|
+
async function fetchData() {
|
|
44
|
+
try {
|
|
45
|
+
const data = await metricsAggregator.collectMonitorData(server, updateInterval);
|
|
46
|
+
// Reset failure count on success
|
|
47
|
+
consecutiveFailures = 0;
|
|
48
|
+
lastGoodData = data;
|
|
49
|
+
const termWidth = screen.width || 80;
|
|
50
|
+
const divider = '─'.repeat(termWidth - 2); // Account for padding
|
|
51
|
+
let content = '';
|
|
52
|
+
// Header
|
|
53
|
+
content += '{bold}{blue-fg}═══ llama.cpp Server Monitor ═══{/blue-fg}{/bold}\n\n';
|
|
54
|
+
// Server Info
|
|
55
|
+
content += '{bold}Server Information{/bold}\n';
|
|
56
|
+
content += divider + '\n';
|
|
57
|
+
const statusIcon = data.server.healthy ? '{green-fg}●{/green-fg}' : '{red-fg}●{/red-fg}';
|
|
58
|
+
const statusText = data.server.healthy ? 'RUNNING' : 'UNHEALTHY';
|
|
59
|
+
content += `Status: ${statusIcon} ${statusText}\n`;
|
|
60
|
+
if (data.server.uptime) {
|
|
61
|
+
content += `Uptime: ${data.server.uptime}\n`;
|
|
62
|
+
}
|
|
63
|
+
content += `Model: ${server.modelName}\n`;
|
|
64
|
+
// Handle null host (legacy configs) by defaulting to 127.0.0.1
|
|
65
|
+
const displayHost = server.host || '127.0.0.1';
|
|
66
|
+
content += `Endpoint: http://${displayHost}:${server.port}\n`;
|
|
67
|
+
content += `Slots: ${data.server.activeSlots} active / ${data.server.totalSlots} total\n`;
|
|
68
|
+
content += '\n';
|
|
69
|
+
// Request Metrics
|
|
70
|
+
if (data.server.totalSlots > 0) {
|
|
71
|
+
content += '{bold}Request Metrics{/bold}\n';
|
|
72
|
+
content += divider + '\n';
|
|
73
|
+
content += `Active: ${data.server.activeSlots} / ${data.server.totalSlots}\n`;
|
|
74
|
+
content += `Idle: ${data.server.idleSlots} / ${data.server.totalSlots}\n`;
|
|
75
|
+
if (data.server.avgPromptSpeed !== undefined && data.server.avgPromptSpeed > 0) {
|
|
76
|
+
content += `Prompt: ${Math.round(data.server.avgPromptSpeed)} tokens/sec\n`;
|
|
77
|
+
}
|
|
78
|
+
if (data.server.avgGenerateSpeed !== undefined && data.server.avgGenerateSpeed > 0) {
|
|
79
|
+
content += `Generate: ${Math.round(data.server.avgGenerateSpeed)} tokens/sec\n`;
|
|
80
|
+
}
|
|
81
|
+
content += '\n';
|
|
82
|
+
}
|
|
83
|
+
// Active Slots Detail
|
|
84
|
+
if (data.server.slots.length > 0) {
|
|
85
|
+
const activeSlots = data.server.slots.filter(s => s.state === 'processing');
|
|
86
|
+
if (activeSlots.length > 0) {
|
|
87
|
+
content += '{bold}Active Slots{/bold}\n';
|
|
88
|
+
content += divider + '\n';
|
|
89
|
+
activeSlots.forEach((slot) => {
|
|
90
|
+
content += `Slot #${slot.id}: {yellow-fg}PROCESSING{/yellow-fg}`;
|
|
91
|
+
if (slot.timings?.predicted_per_second) {
|
|
92
|
+
content += ` - ${Math.round(slot.timings.predicted_per_second)} tok/s`;
|
|
93
|
+
}
|
|
94
|
+
if (slot.n_decoded !== undefined) {
|
|
95
|
+
content += ` - ${slot.n_decoded} tokens`;
|
|
96
|
+
}
|
|
97
|
+
content += '\n';
|
|
98
|
+
});
|
|
99
|
+
content += '\n';
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// System Resources
|
|
103
|
+
content += '{bold}System Resources{/bold}\n';
|
|
104
|
+
content += divider + '\n';
|
|
105
|
+
if (data.system) {
|
|
106
|
+
if (data.system.gpuUsage !== undefined) {
|
|
107
|
+
const bar = createProgressBar(data.system.gpuUsage);
|
|
108
|
+
content += `GPU: {cyan-fg}${bar}{/cyan-fg} ${Math.round(data.system.gpuUsage)}%`;
|
|
109
|
+
if (data.system.temperature !== undefined) {
|
|
110
|
+
content += ` - ${Math.round(data.system.temperature)}°C`;
|
|
111
|
+
}
|
|
112
|
+
content += '\n';
|
|
113
|
+
}
|
|
114
|
+
if (data.system.cpuUsage !== undefined) {
|
|
115
|
+
const bar = createProgressBar(data.system.cpuUsage);
|
|
116
|
+
content += `CPU: {cyan-fg}${bar}{/cyan-fg} ${Math.round(data.system.cpuUsage)}%\n`;
|
|
117
|
+
}
|
|
118
|
+
if (data.system.aneUsage !== undefined && data.system.aneUsage > 1) {
|
|
119
|
+
const bar = createProgressBar(data.system.aneUsage);
|
|
120
|
+
content += `ANE: {cyan-fg}${bar}{/cyan-fg} ${Math.round(data.system.aneUsage)}%\n`;
|
|
121
|
+
}
|
|
122
|
+
if (data.system.memoryTotal > 0) {
|
|
123
|
+
const memoryUsedGB = data.system.memoryUsed / (1024 ** 3);
|
|
124
|
+
const memoryTotalGB = data.system.memoryTotal / (1024 ** 3);
|
|
125
|
+
const memoryPercentage = (data.system.memoryUsed / data.system.memoryTotal) * 100;
|
|
126
|
+
const bar = createProgressBar(memoryPercentage);
|
|
127
|
+
content += `Memory: {cyan-fg}${bar}{/cyan-fg} ${Math.round(memoryPercentage)}% `;
|
|
128
|
+
content += `(${memoryUsedGB.toFixed(1)} / ${memoryTotalGB.toFixed(1)} GB)\n`;
|
|
129
|
+
}
|
|
130
|
+
if (data.system.warnings && data.system.warnings.length > 0) {
|
|
131
|
+
content += `\n{yellow-fg}⚠ ${data.system.warnings.join(', ')}{/yellow-fg}\n`;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
content += '\n';
|
|
135
|
+
// Footer
|
|
136
|
+
content += divider + '\n';
|
|
137
|
+
content += `{gray-fg}Updated: ${data.lastUpdated.toLocaleTimeString()} | `;
|
|
138
|
+
content += `Interval: ${updateInterval}ms | `;
|
|
139
|
+
content += `[R]efresh [+/-]Speed [Q]uit{/gray-fg}`;
|
|
140
|
+
contentBox.setContent(content);
|
|
141
|
+
screen.render();
|
|
142
|
+
}
|
|
143
|
+
catch (err) {
|
|
144
|
+
consecutiveFailures++;
|
|
145
|
+
const isStale = consecutiveFailures >= STALE_THRESHOLD;
|
|
146
|
+
// If we have last good data and we're stale, show it with indicator
|
|
147
|
+
if (lastGoodData && isStale) {
|
|
148
|
+
const termWidth = screen.width || 80;
|
|
149
|
+
const divider = '─'.repeat(termWidth - 2);
|
|
150
|
+
let content = '';
|
|
151
|
+
// Header with stale warning
|
|
152
|
+
content += '{bold}{blue-fg}═══ llama.cpp Server Monitor ═══{/blue-fg}{/bold}\n';
|
|
153
|
+
content += '{bold}{yellow-fg}⚠ CONNECTION LOST - SHOWING STALE DATA{/yellow-fg}{/bold}\n\n';
|
|
154
|
+
// Server Info
|
|
155
|
+
content += '{bold}Server Information{/bold}\n';
|
|
156
|
+
content += divider + '\n';
|
|
157
|
+
const statusIcon = '{yellow-fg}●{/yellow-fg}';
|
|
158
|
+
const statusText = 'STALE';
|
|
159
|
+
content += `Status: ${statusIcon} ${statusText}\n`;
|
|
160
|
+
if (lastGoodData.server.uptime) {
|
|
161
|
+
content += `Uptime: ${lastGoodData.server.uptime}\n`;
|
|
162
|
+
}
|
|
163
|
+
content += `Model: ${server.modelName}\n`;
|
|
164
|
+
// Handle null host (legacy configs) by defaulting to 127.0.0.1
|
|
165
|
+
const displayHost = server.host || '127.0.0.1';
|
|
166
|
+
content += `Endpoint: http://${displayHost}:${server.port}\n`;
|
|
167
|
+
content += `Slots: ${lastGoodData.server.activeSlots} active / ${lastGoodData.server.totalSlots} total\n\n`;
|
|
168
|
+
// Request Metrics
|
|
169
|
+
if (lastGoodData.server.totalSlots > 0) {
|
|
170
|
+
content += '{bold}Request Metrics{/bold} {yellow-fg}(stale){/yellow-fg}\n';
|
|
171
|
+
content += divider + '\n';
|
|
172
|
+
content += `Active: ${lastGoodData.server.activeSlots} / ${lastGoodData.server.totalSlots}\n`;
|
|
173
|
+
content += `Idle: ${lastGoodData.server.idleSlots} / ${lastGoodData.server.totalSlots}\n`;
|
|
174
|
+
if (lastGoodData.server.avgPromptSpeed !== undefined && lastGoodData.server.avgPromptSpeed > 0) {
|
|
175
|
+
content += `Prompt: ${Math.round(lastGoodData.server.avgPromptSpeed)} tokens/sec\n`;
|
|
176
|
+
}
|
|
177
|
+
if (lastGoodData.server.avgGenerateSpeed !== undefined && lastGoodData.server.avgGenerateSpeed > 0) {
|
|
178
|
+
content += `Generate: ${Math.round(lastGoodData.server.avgGenerateSpeed)} tokens/sec\n`;
|
|
179
|
+
}
|
|
180
|
+
content += '\n';
|
|
181
|
+
}
|
|
182
|
+
// Active Slots Detail
|
|
183
|
+
if (lastGoodData.server.slots.length > 0) {
|
|
184
|
+
const activeSlots = lastGoodData.server.slots.filter(s => s.state === 'processing');
|
|
185
|
+
if (activeSlots.length > 0) {
|
|
186
|
+
content += '{bold}Active Slots{/bold} {yellow-fg}(stale){/yellow-fg}\n';
|
|
187
|
+
content += divider + '\n';
|
|
188
|
+
activeSlots.forEach((slot) => {
|
|
189
|
+
content += `Slot #${slot.id}: {yellow-fg}PROCESSING{/yellow-fg}`;
|
|
190
|
+
if (slot.timings?.predicted_per_second) {
|
|
191
|
+
content += ` - ${Math.round(slot.timings.predicted_per_second)} tok/s`;
|
|
192
|
+
}
|
|
193
|
+
if (slot.n_decoded !== undefined) {
|
|
194
|
+
content += ` - ${slot.n_decoded} tokens`;
|
|
195
|
+
}
|
|
196
|
+
content += '\n';
|
|
197
|
+
});
|
|
198
|
+
content += '\n';
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
// System Resources
|
|
202
|
+
content += '{bold}System Resources{/bold} {yellow-fg}(stale){/yellow-fg}\n';
|
|
203
|
+
content += divider + '\n';
|
|
204
|
+
if (lastGoodData.system) {
|
|
205
|
+
if (lastGoodData.system.gpuUsage !== undefined) {
|
|
206
|
+
const bar = createProgressBar(lastGoodData.system.gpuUsage);
|
|
207
|
+
content += `GPU: {cyan-fg}${bar}{/cyan-fg} ${Math.round(lastGoodData.system.gpuUsage)}%`;
|
|
208
|
+
if (lastGoodData.system.temperature !== undefined) {
|
|
209
|
+
content += ` - ${Math.round(lastGoodData.system.temperature)}°C`;
|
|
210
|
+
}
|
|
211
|
+
content += '\n';
|
|
212
|
+
}
|
|
213
|
+
if (lastGoodData.system.cpuUsage !== undefined) {
|
|
214
|
+
const bar = createProgressBar(lastGoodData.system.cpuUsage);
|
|
215
|
+
content += `CPU: {cyan-fg}${bar}{/cyan-fg} ${Math.round(lastGoodData.system.cpuUsage)}%\n`;
|
|
216
|
+
}
|
|
217
|
+
if (lastGoodData.system.aneUsage !== undefined && lastGoodData.system.aneUsage > 1) {
|
|
218
|
+
const bar = createProgressBar(lastGoodData.system.aneUsage);
|
|
219
|
+
content += `ANE: {cyan-fg}${bar}{/cyan-fg} ${Math.round(lastGoodData.system.aneUsage)}%\n`;
|
|
220
|
+
}
|
|
221
|
+
if (lastGoodData.system.memoryTotal > 0) {
|
|
222
|
+
const memoryUsedGB = lastGoodData.system.memoryUsed / (1024 ** 3);
|
|
223
|
+
const memoryTotalGB = lastGoodData.system.memoryTotal / (1024 ** 3);
|
|
224
|
+
const memoryPercentage = (lastGoodData.system.memoryUsed / lastGoodData.system.memoryTotal) * 100;
|
|
225
|
+
const bar = createProgressBar(memoryPercentage);
|
|
226
|
+
content += `Memory: {cyan-fg}${bar}{/cyan-fg} ${Math.round(memoryPercentage)}% `;
|
|
227
|
+
content += `(${memoryUsedGB.toFixed(1)} / ${memoryTotalGB.toFixed(1)} GB)\n`;
|
|
228
|
+
}
|
|
229
|
+
if (lastGoodData.system.warnings && lastGoodData.system.warnings.length > 0) {
|
|
230
|
+
content += `\n{yellow-fg}⚠ ${lastGoodData.system.warnings.join(', ')}{/yellow-fg}\n`;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
content += '\n';
|
|
234
|
+
// Footer
|
|
235
|
+
content += divider + '\n';
|
|
236
|
+
content += `{yellow-fg}Last good data: ${lastGoodData.lastUpdated.toLocaleTimeString()}{/yellow-fg}\n`;
|
|
237
|
+
content += `{yellow-fg}Connection failures: ${consecutiveFailures}{/yellow-fg}\n`;
|
|
238
|
+
content += `{gray-fg}Interval: ${updateInterval}ms | [R]efresh [+/-]Speed [Q]uit{/gray-fg}`;
|
|
239
|
+
contentBox.setContent(content);
|
|
240
|
+
screen.render();
|
|
241
|
+
}
|
|
242
|
+
else if (!lastGoodData || consecutiveFailures < STALE_THRESHOLD) {
|
|
243
|
+
// Show connection error (either no last data or not stale yet)
|
|
244
|
+
const errorMsg = err instanceof Error ? err.message : 'Unknown error';
|
|
245
|
+
const retryMsg = consecutiveFailures < STALE_THRESHOLD
|
|
246
|
+
? `Retrying... (${consecutiveFailures}/${STALE_THRESHOLD})`
|
|
247
|
+
: 'Connection lost';
|
|
248
|
+
contentBox.setContent('{bold}{red-fg}Connection Error{/red-fg}{/bold}\n\n' +
|
|
249
|
+
`{red-fg}${errorMsg}{/red-fg}\n\n` +
|
|
250
|
+
`{yellow-fg}${retryMsg}{/yellow-fg}\n\n` +
|
|
251
|
+
'{gray-fg}Press [R] to retry or [Q] to quit{/gray-fg}');
|
|
252
|
+
screen.render();
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
// Polling
|
|
257
|
+
function startPolling() {
|
|
258
|
+
if (intervalId)
|
|
259
|
+
clearInterval(intervalId);
|
|
260
|
+
fetchData();
|
|
261
|
+
intervalId = setInterval(fetchData, updateInterval);
|
|
262
|
+
}
|
|
263
|
+
// Keyboard shortcuts
|
|
264
|
+
screen.key(['r', 'R'], () => {
|
|
265
|
+
fetchData();
|
|
266
|
+
});
|
|
267
|
+
screen.key(['+', '='], () => {
|
|
268
|
+
updateInterval = Math.max(500, updateInterval - 500);
|
|
269
|
+
startPolling();
|
|
270
|
+
});
|
|
271
|
+
screen.key(['-', '_'], () => {
|
|
272
|
+
updateInterval = Math.min(10000, updateInterval + 500);
|
|
273
|
+
startPolling();
|
|
274
|
+
});
|
|
275
|
+
screen.key(['q', 'Q', 'C-c'], () => {
|
|
276
|
+
if (intervalId)
|
|
277
|
+
clearInterval(intervalId);
|
|
278
|
+
screen.destroy();
|
|
279
|
+
process.exit(0);
|
|
280
|
+
});
|
|
281
|
+
// Initial display
|
|
282
|
+
contentBox.setContent('{cyan-fg}⏳ Connecting to server...{/cyan-fg}');
|
|
283
|
+
screen.render();
|
|
284
|
+
startPolling();
|
|
285
|
+
// Cleanup
|
|
286
|
+
screen.on('destroy', () => {
|
|
287
|
+
if (intervalId)
|
|
288
|
+
clearInterval(intervalId);
|
|
289
|
+
// Note: macmon child processes will automatically die when parent exits
|
|
290
|
+
// since they're spawned with detached: false
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
//# sourceMappingURL=MonitorApp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MonitorApp.js","sourceRoot":"","sources":["../../src/tui/MonitorApp.ts"],"names":[],"mappings":";;;;;AAKA,0CAmWC;AAxWD,sDAA8B;AAE9B,wEAAiE;AAG1D,KAAK,UAAU,eAAe,CACnC,MAA8B,EAC9B,MAAoB;IAEpB,IAAI,cAAc,GAAG,IAAI,CAAC;IAC1B,IAAI,UAAU,GAA0B,IAAI,CAAC;IAC7C,IAAI,mBAAmB,GAAG,CAAC,CAAC;IAC5B,IAAI,YAAY,GAAuB,IAAI,CAAC;IAC5C,MAAM,eAAe,GAAG,CAAC,CAAC;IAC1B,MAAM,iBAAiB,GAAG,IAAI,yCAAiB,CAAC,MAAM,CAAC,CAAC;IAExD,gCAAgC;IAChC,MAAM,UAAU,GAAG,iBAAO,CAAC,GAAG,CAAC;QAC7B,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI;QACV,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,IAAI;QAClB,IAAI,EAAE,IAAI;QACV,EAAE,EAAE,IA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