@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,496 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.createMultiServerMonitorUI = createMultiServerMonitorUI;
|
|
40
|
+
const blessed_1 = __importDefault(require("blessed"));
|
|
41
|
+
const metrics_aggregator_js_1 = require("../lib/metrics-aggregator.js");
|
|
42
|
+
const system_collector_js_1 = require("../lib/system-collector.js");
|
|
43
|
+
async function createMultiServerMonitorUI(screen, servers) {
|
|
44
|
+
let updateInterval = 2000;
|
|
45
|
+
let intervalId = null;
|
|
46
|
+
let viewMode = 'list';
|
|
47
|
+
let selectedServerIndex = 0;
|
|
48
|
+
let isLoading = false;
|
|
49
|
+
let lastSystemMetrics = null;
|
|
50
|
+
// Spinner animation
|
|
51
|
+
const spinnerFrames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
52
|
+
let spinnerFrameIndex = 0;
|
|
53
|
+
let spinnerIntervalId = null;
|
|
54
|
+
const systemCollector = new system_collector_js_1.SystemCollector();
|
|
55
|
+
const aggregators = new Map();
|
|
56
|
+
const serverDataMap = new Map();
|
|
57
|
+
// Initialize aggregators for each server
|
|
58
|
+
for (const server of servers) {
|
|
59
|
+
aggregators.set(server.id, new metrics_aggregator_js_1.MetricsAggregator(server));
|
|
60
|
+
serverDataMap.set(server.id, {
|
|
61
|
+
server,
|
|
62
|
+
data: null,
|
|
63
|
+
error: null,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
// Single scrollable content box
|
|
67
|
+
const contentBox = blessed_1.default.box({
|
|
68
|
+
top: 0,
|
|
69
|
+
left: 0,
|
|
70
|
+
width: '100%',
|
|
71
|
+
height: '100%',
|
|
72
|
+
tags: true,
|
|
73
|
+
scrollable: true,
|
|
74
|
+
alwaysScroll: true,
|
|
75
|
+
keys: true,
|
|
76
|
+
vi: true,
|
|
77
|
+
mouse: true,
|
|
78
|
+
scrollbar: {
|
|
79
|
+
ch: '█',
|
|
80
|
+
style: {
|
|
81
|
+
fg: 'blue',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
screen.append(contentBox);
|
|
86
|
+
// Helper to create progress bar
|
|
87
|
+
function createProgressBar(percentage, width = 30) {
|
|
88
|
+
const filled = Math.round((percentage / 100) * width);
|
|
89
|
+
const empty = width - filled;
|
|
90
|
+
return '[' + '█'.repeat(Math.max(0, filled)) + '░'.repeat(Math.max(0, empty)) + ']';
|
|
91
|
+
}
|
|
92
|
+
// Render system resources section
|
|
93
|
+
function renderSystemResources(systemMetrics) {
|
|
94
|
+
let content = '';
|
|
95
|
+
content += '{bold}System Resources{/bold}\n';
|
|
96
|
+
const termWidth = screen.width || 80;
|
|
97
|
+
const divider = '─'.repeat(termWidth - 2);
|
|
98
|
+
content += divider + '\n';
|
|
99
|
+
if (systemMetrics) {
|
|
100
|
+
if (systemMetrics.gpuUsage !== undefined) {
|
|
101
|
+
const bar = createProgressBar(systemMetrics.gpuUsage);
|
|
102
|
+
content += `GPU: {cyan-fg}${bar}{/cyan-fg} ${Math.round(systemMetrics.gpuUsage)}%`;
|
|
103
|
+
if (systemMetrics.temperature !== undefined) {
|
|
104
|
+
content += ` - ${Math.round(systemMetrics.temperature)}°C`;
|
|
105
|
+
}
|
|
106
|
+
content += '\n';
|
|
107
|
+
}
|
|
108
|
+
if (systemMetrics.cpuUsage !== undefined) {
|
|
109
|
+
const bar = createProgressBar(systemMetrics.cpuUsage);
|
|
110
|
+
content += `CPU: {cyan-fg}${bar}{/cyan-fg} ${Math.round(systemMetrics.cpuUsage)}%\n`;
|
|
111
|
+
}
|
|
112
|
+
if (systemMetrics.aneUsage !== undefined && systemMetrics.aneUsage > 1) {
|
|
113
|
+
const bar = createProgressBar(systemMetrics.aneUsage);
|
|
114
|
+
content += `ANE: {cyan-fg}${bar}{/cyan-fg} ${Math.round(systemMetrics.aneUsage)}%\n`;
|
|
115
|
+
}
|
|
116
|
+
if (systemMetrics.memoryTotal > 0) {
|
|
117
|
+
const memoryUsedGB = systemMetrics.memoryUsed / (1024 ** 3);
|
|
118
|
+
const memoryTotalGB = systemMetrics.memoryTotal / (1024 ** 3);
|
|
119
|
+
const memoryPercentage = (systemMetrics.memoryUsed / systemMetrics.memoryTotal) * 100;
|
|
120
|
+
const bar = createProgressBar(memoryPercentage);
|
|
121
|
+
content += `Memory: {cyan-fg}${bar}{/cyan-fg} ${Math.round(memoryPercentage)}% `;
|
|
122
|
+
content += `(${memoryUsedGB.toFixed(1)} / ${memoryTotalGB.toFixed(1)} GB)\n`;
|
|
123
|
+
}
|
|
124
|
+
if (systemMetrics.warnings && systemMetrics.warnings.length > 0) {
|
|
125
|
+
content += `\n{yellow-fg}⚠ ${systemMetrics.warnings.join(', ')}{/yellow-fg}\n`;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
content += '{gray-fg}Collecting system metrics...{/gray-fg}\n';
|
|
130
|
+
}
|
|
131
|
+
return content;
|
|
132
|
+
}
|
|
133
|
+
// Show loading spinner
|
|
134
|
+
function showLoading() {
|
|
135
|
+
if (isLoading)
|
|
136
|
+
return; // Already loading
|
|
137
|
+
isLoading = true;
|
|
138
|
+
spinnerFrameIndex = 0;
|
|
139
|
+
// Start spinner animation (80ms per frame = smooth rotation)
|
|
140
|
+
spinnerIntervalId = setInterval(() => {
|
|
141
|
+
spinnerFrameIndex = (spinnerFrameIndex + 1) % spinnerFrames.length;
|
|
142
|
+
// Re-render current view with updated spinner frame
|
|
143
|
+
let content = '';
|
|
144
|
+
if (viewMode === 'list') {
|
|
145
|
+
content = renderListView(lastSystemMetrics);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
content = renderDetailView(lastSystemMetrics);
|
|
149
|
+
}
|
|
150
|
+
contentBox.setContent(content);
|
|
151
|
+
screen.render();
|
|
152
|
+
}, 80);
|
|
153
|
+
// Immediate first render
|
|
154
|
+
let content = '';
|
|
155
|
+
if (viewMode === 'list') {
|
|
156
|
+
content = renderListView(lastSystemMetrics);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
content = renderDetailView(lastSystemMetrics);
|
|
160
|
+
}
|
|
161
|
+
contentBox.setContent(content);
|
|
162
|
+
screen.render();
|
|
163
|
+
}
|
|
164
|
+
// Hide loading spinner
|
|
165
|
+
function hideLoading() {
|
|
166
|
+
isLoading = false;
|
|
167
|
+
if (spinnerIntervalId) {
|
|
168
|
+
clearInterval(spinnerIntervalId);
|
|
169
|
+
spinnerIntervalId = null;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
// Render list view
|
|
173
|
+
function renderListView(systemMetrics) {
|
|
174
|
+
const termWidth = screen.width || 80;
|
|
175
|
+
const divider = '─'.repeat(termWidth - 2);
|
|
176
|
+
let content = '';
|
|
177
|
+
// Header
|
|
178
|
+
content += '{bold}{blue-fg}═══ llama.cpp Multi-Server Monitor ═══{/blue-fg}{/bold}\n';
|
|
179
|
+
// Status line with optional spinner
|
|
180
|
+
const statusPlainText = 'Press 1-9 for details | [F] Filter | [Q] Quit';
|
|
181
|
+
const spinnerChar = isLoading ? spinnerFrames[spinnerFrameIndex] : '';
|
|
182
|
+
const spinnerText = spinnerChar ? ` {cyan-fg}${spinnerChar}{/cyan-fg}` : '';
|
|
183
|
+
content += `{gray-fg}${statusPlainText}${spinnerText}{/gray-fg}\n\n`;
|
|
184
|
+
// System resources
|
|
185
|
+
content += renderSystemResources(systemMetrics);
|
|
186
|
+
content += '\n';
|
|
187
|
+
// Server list header
|
|
188
|
+
const runningCount = servers.filter(s => s.status === 'running').length;
|
|
189
|
+
const stoppedCount = servers.filter(s => s.status !== 'running').length;
|
|
190
|
+
content += `{bold}Servers (${runningCount} running, ${stoppedCount} stopped){/bold}\n`;
|
|
191
|
+
content += '{gray-fg}Press number for details{/gray-fg}\n';
|
|
192
|
+
content += divider + '\n';
|
|
193
|
+
// Table header
|
|
194
|
+
content += '{bold}# │ Server ID │ Port │ Status │ Slots │ tok/s │ Memory{/bold}\n';
|
|
195
|
+
content += divider + '\n';
|
|
196
|
+
// Server rows
|
|
197
|
+
servers.forEach((server, index) => {
|
|
198
|
+
const serverData = serverDataMap.get(server.id);
|
|
199
|
+
const num = index + 1;
|
|
200
|
+
// Server ID (truncate if needed)
|
|
201
|
+
const serverId = server.id.padEnd(16).substring(0, 16);
|
|
202
|
+
// Port
|
|
203
|
+
const port = server.port.toString().padStart(4);
|
|
204
|
+
// Status
|
|
205
|
+
let status = '';
|
|
206
|
+
if (serverData?.data) {
|
|
207
|
+
if (serverData.data.server.healthy) {
|
|
208
|
+
status = '{green-fg}● RUN{/green-fg} ';
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
status = '{red-fg}● ERR{/red-fg} ';
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
else if (server.status === 'running') {
|
|
215
|
+
status = '{yellow-fg}● ...{/yellow-fg} ';
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
status = '{gray-fg}○ STOP{/gray-fg}';
|
|
219
|
+
}
|
|
220
|
+
// Slots
|
|
221
|
+
let slots = '- ';
|
|
222
|
+
if (serverData?.data?.server) {
|
|
223
|
+
const active = serverData.data.server.activeSlots;
|
|
224
|
+
const total = serverData.data.server.totalSlots;
|
|
225
|
+
slots = `${active}/${total}`.padStart(5);
|
|
226
|
+
}
|
|
227
|
+
// tok/s
|
|
228
|
+
let tokensPerSec = '- ';
|
|
229
|
+
if (serverData?.data?.server.avgGenerateSpeed !== undefined &&
|
|
230
|
+
serverData.data.server.avgGenerateSpeed > 0) {
|
|
231
|
+
tokensPerSec = Math.round(serverData.data.server.avgGenerateSpeed).toString().padStart(6);
|
|
232
|
+
}
|
|
233
|
+
// Memory (actual process memory from top command)
|
|
234
|
+
let memory = '- ';
|
|
235
|
+
if (serverData?.data?.server.processMemory) {
|
|
236
|
+
const bytes = serverData.data.server.processMemory;
|
|
237
|
+
// Format as GB/MB depending on size
|
|
238
|
+
if (bytes >= 1024 * 1024 * 1024) {
|
|
239
|
+
const gb = (bytes / (1024 * 1024 * 1024)).toFixed(1);
|
|
240
|
+
memory = `${gb} GB`.padStart(7);
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
const mb = Math.round(bytes / (1024 * 1024));
|
|
244
|
+
memory = `${mb} MB`.padStart(7);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
content += `${num} │ ${serverId} │ ${port} │ ${status} │ ${slots} │ ${tokensPerSec} │ ${memory}\n`;
|
|
248
|
+
});
|
|
249
|
+
// Footer
|
|
250
|
+
content += '\n' + divider + '\n';
|
|
251
|
+
content += `{gray-fg}Updated: ${new Date().toLocaleTimeString()} | `;
|
|
252
|
+
content += `Interval: ${updateInterval}ms | [R]efresh [+/-]Speed{/gray-fg}`;
|
|
253
|
+
return content;
|
|
254
|
+
}
|
|
255
|
+
// Render detail view for selected server
|
|
256
|
+
function renderDetailView(systemMetrics) {
|
|
257
|
+
const server = servers[selectedServerIndex];
|
|
258
|
+
const serverData = serverDataMap.get(server.id);
|
|
259
|
+
const termWidth = screen.width || 80;
|
|
260
|
+
const divider = '─'.repeat(termWidth - 2);
|
|
261
|
+
let content = '';
|
|
262
|
+
// Header
|
|
263
|
+
content += `{bold}{blue-fg}═══ Server #${selectedServerIndex + 1}: ${server.id} (${server.port}) ═══{/blue-fg}{/bold}\n`;
|
|
264
|
+
// Status line with optional spinner
|
|
265
|
+
const statusPlainText = '[ESC] Back to list | [Q] Quit';
|
|
266
|
+
const spinnerChar = isLoading ? spinnerFrames[spinnerFrameIndex] : '';
|
|
267
|
+
const spinnerText = spinnerChar ? ` {cyan-fg}${spinnerChar}{/cyan-fg}` : '';
|
|
268
|
+
content += `{gray-fg}${statusPlainText}${spinnerText}{/gray-fg}\n\n`;
|
|
269
|
+
// System resources
|
|
270
|
+
content += renderSystemResources(systemMetrics);
|
|
271
|
+
content += '\n';
|
|
272
|
+
if (!serverData?.data) {
|
|
273
|
+
content += '{yellow-fg}Loading server data...{/yellow-fg}\n';
|
|
274
|
+
return content;
|
|
275
|
+
}
|
|
276
|
+
const data = serverData.data;
|
|
277
|
+
// Server Information
|
|
278
|
+
content += '{bold}Server Information{/bold}\n';
|
|
279
|
+
content += divider + '\n';
|
|
280
|
+
const statusIcon = data.server.healthy ? '{green-fg}●{/green-fg}' : '{red-fg}●{/red-fg}';
|
|
281
|
+
const statusText = data.server.healthy ? 'RUNNING' : 'UNHEALTHY';
|
|
282
|
+
content += `Status: ${statusIcon} ${statusText}`;
|
|
283
|
+
if (data.server.uptime) {
|
|
284
|
+
content += ` Uptime: ${data.server.uptime}`;
|
|
285
|
+
}
|
|
286
|
+
content += '\n';
|
|
287
|
+
content += `Model: ${server.modelName}`;
|
|
288
|
+
if (data.server.contextSize) {
|
|
289
|
+
content += ` Context: ${data.server.contextSize} tokens`;
|
|
290
|
+
}
|
|
291
|
+
content += '\n';
|
|
292
|
+
// Handle null host (legacy configs) by defaulting to 127.0.0.1
|
|
293
|
+
const displayHost = server.host || '127.0.0.1';
|
|
294
|
+
content += `Endpoint: http://${displayHost}:${server.port}`;
|
|
295
|
+
// Add actual process memory (if available)
|
|
296
|
+
if (data.server.processMemory) {
|
|
297
|
+
const bytes = data.server.processMemory;
|
|
298
|
+
let memStr;
|
|
299
|
+
if (bytes >= 1024 * 1024 * 1024) {
|
|
300
|
+
memStr = `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
memStr = `${Math.round(bytes / (1024 * 1024))} MB`;
|
|
304
|
+
}
|
|
305
|
+
content += ` Memory: ${memStr}\n`;
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
content += '\n';
|
|
309
|
+
}
|
|
310
|
+
content += `Slots: ${data.server.activeSlots} active / ${data.server.totalSlots} total\n`;
|
|
311
|
+
content += '\n';
|
|
312
|
+
// Request Metrics
|
|
313
|
+
if (data.server.totalSlots > 0) {
|
|
314
|
+
content += '{bold}Request Metrics{/bold}\n';
|
|
315
|
+
content += divider + '\n';
|
|
316
|
+
content += `Active: ${data.server.activeSlots} / ${data.server.totalSlots}\n`;
|
|
317
|
+
content += `Idle: ${data.server.idleSlots} / ${data.server.totalSlots}\n`;
|
|
318
|
+
if (data.server.avgPromptSpeed !== undefined && data.server.avgPromptSpeed > 0) {
|
|
319
|
+
content += `Prompt: ${Math.round(data.server.avgPromptSpeed)} tokens/sec\n`;
|
|
320
|
+
}
|
|
321
|
+
if (data.server.avgGenerateSpeed !== undefined && data.server.avgGenerateSpeed > 0) {
|
|
322
|
+
content += `Generate: ${Math.round(data.server.avgGenerateSpeed)} tokens/sec\n`;
|
|
323
|
+
}
|
|
324
|
+
content += '\n';
|
|
325
|
+
}
|
|
326
|
+
// Active Slots Detail
|
|
327
|
+
if (data.server.slots.length > 0) {
|
|
328
|
+
const activeSlots = data.server.slots.filter(s => s.state === 'processing');
|
|
329
|
+
if (activeSlots.length > 0) {
|
|
330
|
+
content += '{bold}Active Slots{/bold}\n';
|
|
331
|
+
content += divider + '\n';
|
|
332
|
+
activeSlots.forEach((slot) => {
|
|
333
|
+
content += `Slot #${slot.id}: {yellow-fg}PROCESSING{/yellow-fg}`;
|
|
334
|
+
if (slot.timings?.predicted_per_second) {
|
|
335
|
+
content += ` - ${Math.round(slot.timings.predicted_per_second)} tok/s`;
|
|
336
|
+
}
|
|
337
|
+
if (slot.n_decoded !== undefined) {
|
|
338
|
+
content += ` - ${slot.n_decoded}`;
|
|
339
|
+
if (slot.n_ctx) {
|
|
340
|
+
content += ` / ${slot.n_ctx}`;
|
|
341
|
+
}
|
|
342
|
+
content += ' tokens';
|
|
343
|
+
}
|
|
344
|
+
content += '\n';
|
|
345
|
+
});
|
|
346
|
+
content += '\n';
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
// Footer
|
|
350
|
+
content += divider + '\n';
|
|
351
|
+
content += `{gray-fg}Updated: ${data.lastUpdated.toLocaleTimeString()} | `;
|
|
352
|
+
content += `Interval: ${updateInterval}ms | [R]efresh [+/-]Speed{/gray-fg}`;
|
|
353
|
+
return content;
|
|
354
|
+
}
|
|
355
|
+
// Fetch and update display
|
|
356
|
+
async function fetchData() {
|
|
357
|
+
try {
|
|
358
|
+
// Collect system metrics ONCE for all servers (not per-server)
|
|
359
|
+
// This prevents spawning multiple macmon processes
|
|
360
|
+
const systemMetricsPromise = systemCollector.collectSystemMetrics();
|
|
361
|
+
// Batch collect process memory for ALL servers in one top call
|
|
362
|
+
// This prevents spawning multiple top processes (5x speedup)
|
|
363
|
+
const { getBatchProcessMemory } = await Promise.resolve().then(() => __importStar(require('../utils/process-utils.js')));
|
|
364
|
+
const pids = servers.filter(s => s.pid).map(s => s.pid);
|
|
365
|
+
const memoryMapPromise = pids.length > 0
|
|
366
|
+
? getBatchProcessMemory(pids)
|
|
367
|
+
: Promise.resolve(new Map());
|
|
368
|
+
// Wait for memory batch to complete
|
|
369
|
+
const memoryMap = await memoryMapPromise;
|
|
370
|
+
// Collect server metrics only (NOT system metrics) for each server
|
|
371
|
+
const promises = servers.map(async (server) => {
|
|
372
|
+
const aggregator = aggregators.get(server.id);
|
|
373
|
+
try {
|
|
374
|
+
// Use collectServerMetrics instead of collectMonitorData
|
|
375
|
+
// to avoid spawning macmon per server
|
|
376
|
+
// Pass pre-fetched memory to avoid spawning top per server
|
|
377
|
+
const serverMetrics = await aggregator.collectServerMetrics(server, server.pid ? memoryMap.get(server.pid) ?? null : null);
|
|
378
|
+
// Build MonitorData manually with shared system metrics
|
|
379
|
+
const data = {
|
|
380
|
+
server: serverMetrics,
|
|
381
|
+
system: undefined, // Will be set after system metrics resolve
|
|
382
|
+
lastUpdated: new Date(),
|
|
383
|
+
updateInterval,
|
|
384
|
+
consecutiveFailures: 0,
|
|
385
|
+
};
|
|
386
|
+
serverDataMap.set(server.id, {
|
|
387
|
+
server,
|
|
388
|
+
data,
|
|
389
|
+
error: null,
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
catch (err) {
|
|
393
|
+
serverDataMap.set(server.id, {
|
|
394
|
+
server,
|
|
395
|
+
data: null,
|
|
396
|
+
error: err instanceof Error ? err.message : 'Unknown error',
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
});
|
|
400
|
+
// Wait for both system metrics and server metrics to complete
|
|
401
|
+
const systemMetrics = await systemMetricsPromise;
|
|
402
|
+
await Promise.all(promises);
|
|
403
|
+
// Store system metrics for loading state
|
|
404
|
+
lastSystemMetrics = systemMetrics;
|
|
405
|
+
// Update all server data with shared system metrics
|
|
406
|
+
for (const serverData of serverDataMap.values()) {
|
|
407
|
+
if (serverData.data) {
|
|
408
|
+
serverData.data.system = systemMetrics;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
// Render once with complete data
|
|
412
|
+
let content = '';
|
|
413
|
+
if (viewMode === 'list') {
|
|
414
|
+
content = renderListView(systemMetrics);
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
content = renderDetailView(systemMetrics);
|
|
418
|
+
}
|
|
419
|
+
contentBox.setContent(content);
|
|
420
|
+
screen.render();
|
|
421
|
+
// Clear loading state
|
|
422
|
+
hideLoading();
|
|
423
|
+
}
|
|
424
|
+
catch (err) {
|
|
425
|
+
const errorMsg = err instanceof Error ? err.message : 'Unknown error';
|
|
426
|
+
contentBox.setContent('{bold}{red-fg}Error{/red-fg}{/bold}\n\n' +
|
|
427
|
+
`{red-fg}${errorMsg}{/red-fg}\n\n` +
|
|
428
|
+
'{gray-fg}Press [R] to retry or [Q] to quit{/gray-fg}');
|
|
429
|
+
screen.render();
|
|
430
|
+
// Clear loading state on error too
|
|
431
|
+
isLoading = false;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
// Polling
|
|
435
|
+
function startPolling() {
|
|
436
|
+
if (intervalId)
|
|
437
|
+
clearInterval(intervalId);
|
|
438
|
+
fetchData();
|
|
439
|
+
intervalId = setInterval(fetchData, updateInterval);
|
|
440
|
+
}
|
|
441
|
+
// Keyboard shortcuts - List view
|
|
442
|
+
screen.key(['1', '2', '3', '4', '5', '6', '7', '8', '9'], (ch) => {
|
|
443
|
+
const index = parseInt(ch, 10) - 1;
|
|
444
|
+
if (index >= 0 && index < servers.length) {
|
|
445
|
+
showLoading();
|
|
446
|
+
selectedServerIndex = index;
|
|
447
|
+
viewMode = 'detail';
|
|
448
|
+
fetchData();
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
// Keyboard shortcuts - Detail view
|
|
452
|
+
screen.key(['escape'], () => {
|
|
453
|
+
if (viewMode === 'detail') {
|
|
454
|
+
showLoading();
|
|
455
|
+
viewMode = 'list';
|
|
456
|
+
fetchData();
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
// Keyboard shortcuts - Common
|
|
460
|
+
screen.key(['r', 'R'], () => {
|
|
461
|
+
showLoading();
|
|
462
|
+
fetchData();
|
|
463
|
+
});
|
|
464
|
+
screen.key(['+', '='], () => {
|
|
465
|
+
updateInterval = Math.max(500, updateInterval - 500);
|
|
466
|
+
startPolling();
|
|
467
|
+
});
|
|
468
|
+
screen.key(['-', '_'], () => {
|
|
469
|
+
updateInterval = Math.min(10000, updateInterval + 500);
|
|
470
|
+
startPolling();
|
|
471
|
+
});
|
|
472
|
+
screen.key(['q', 'Q', 'C-c'], () => {
|
|
473
|
+
showLoading();
|
|
474
|
+
if (intervalId)
|
|
475
|
+
clearInterval(intervalId);
|
|
476
|
+
if (spinnerIntervalId)
|
|
477
|
+
clearInterval(spinnerIntervalId);
|
|
478
|
+
// Small delay to show the loading state before exit
|
|
479
|
+
setTimeout(() => {
|
|
480
|
+
screen.destroy();
|
|
481
|
+
process.exit(0);
|
|
482
|
+
}, 100);
|
|
483
|
+
});
|
|
484
|
+
// Initial display
|
|
485
|
+
contentBox.setContent('{cyan-fg}⏳ Connecting to servers...{/cyan-fg}');
|
|
486
|
+
screen.render();
|
|
487
|
+
startPolling();
|
|
488
|
+
// Cleanup
|
|
489
|
+
screen.on('destroy', () => {
|
|
490
|
+
if (intervalId)
|
|
491
|
+
clearInterval(intervalId);
|
|
492
|
+
// Note: macmon child processes will automatically die when parent exits
|
|
493
|
+
// since they're spawned with detached: false
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
//# sourceMappingURL=MultiServerMonitorApp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultiServerMonitorApp.js","sourceRoot":"","sources":["../../src/tui/MultiServerMonitorApp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,gEAohBC;AAliBD,sDAA8B;AAE9B,wEAAiE;AACjE,oEAA6D;AAWtD,KAAK,UAAU,0BAA0B,CAC9C,MAA8B,EAC9B,OAAuB;IAEvB,IAAI,cAAc,GAAG,IAAI,CAAC;IAC1B,IAAI,UAAU,GAA0B,IAAI,CAAC;IAC7C,IAAI,QAAQ,GAAa,MAAM,CAAC;IAChC,IAAI,mBAAmB,GAAG,CAAC,CAAC;IAC5B,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI,iBAAiB,GAAyB,IAAI,CAAC;IAEnD,oBAAoB;IACpB,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IACzE,IAAI,iBAAiB,GAAG,CAAC,CAAC;IAC1B,IAAI,iBAAiB,GAA0B,IAAI,CAAC;IAEpD,MAAM,eAAe,GAAG,IAAI,qCAAe,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ACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,eAAe,qBAsB7D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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.ErrorState = ErrorState;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const ink_1 = require("ink");
|
|
9
|
+
function ErrorState({ error, onRetry }) {
|
|
10
|
+
return (react_1.default.createElement(ink_1.Box, { flexDirection: "column", padding: 2, borderStyle: "round", borderColor: "red" },
|
|
11
|
+
react_1.default.createElement(ink_1.Box, null,
|
|
12
|
+
react_1.default.createElement(ink_1.Text, { bold: true, color: "red" }, "\u26A0\uFE0F Connection Error")),
|
|
13
|
+
react_1.default.createElement(ink_1.Box, { marginTop: 1 },
|
|
14
|
+
react_1.default.createElement(ink_1.Text, null, error)),
|
|
15
|
+
react_1.default.createElement(ink_1.Box, { marginTop: 2 },
|
|
16
|
+
react_1.default.createElement(ink_1.Text, { dimColor: true }, "Press "),
|
|
17
|
+
react_1.default.createElement(ink_1.Text, { bold: true }, "[R]"),
|
|
18
|
+
react_1.default.createElement(ink_1.Text, { dimColor: true }, " to retry or "),
|
|
19
|
+
react_1.default.createElement(ink_1.Text, { bold: true }, "[Q]"),
|
|
20
|
+
react_1.default.createElement(ink_1.Text, { dimColor: true }, " to quit"))));
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=ErrorState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorState.js","sourceRoot":"","sources":["../../../src/tui/components/ErrorState.tsx"],"names":[],"mappings":";;;;;AAQA,gCAsBC;AA9BD,kDAA0B;AAC1B,6BAAgC;AAOhC,SAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,OAAO,EAAmB;IAC5D,OAAO,CACL,8BAAC,SAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,EAAE,WAAW,EAAC,OAAO,EAAC,WAAW,EAAC,KAAK;QAC3E,8BAAC,SAAG;YACF,8BAAC,UAAI,IAAC,IAAI,QAAC,KAAK,EAAC,KAAK,qCAEf,CACH;QAEN,8BAAC,SAAG,IAAC,SAAS,EAAE,CAAC;YACf,8BAAC,UAAI,QAAE,KAAK,CAAQ,CAChB;QAEN,8BAAC,SAAG,IAAC,SAAS,EAAE,CAAC;YACf,8BAAC,UAAI,IAAC,QAAQ,mBAAc;YAC5B,8BAAC,UAAI,IAAC,IAAI,gBAAW;YACrB,8BAAC,UAAI,IAAC,QAAQ,0BAAqB;YACnC,8BAAC,UAAI,IAAC,IAAI,gBAAW;YACrB,8BAAC,UAAI,IAAC,QAAQ,qBAAgB,CAC1B,CACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingState.d.ts","sourceRoot":"","sources":["../../../src/tui/components/LoadingState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,iBAAiB;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,YAAY,CAAC,EAAE,OAAsB,EAAE,QAAQ,EAAE,EAAE,iBAAiB,qBAanF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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.LoadingState = LoadingState;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const ink_1 = require("ink");
|
|
9
|
+
function LoadingState({ message = 'Loading...', progress }) {
|
|
10
|
+
return (react_1.default.createElement(ink_1.Box, { flexDirection: "column", padding: 2 },
|
|
11
|
+
react_1.default.createElement(ink_1.Box, null,
|
|
12
|
+
react_1.default.createElement(ink_1.Text, { color: "cyan" },
|
|
13
|
+
"\u23F3 ",
|
|
14
|
+
message)),
|
|
15
|
+
progress !== undefined && (react_1.default.createElement(ink_1.Box, { marginTop: 1 },
|
|
16
|
+
react_1.default.createElement(ink_1.Text, { dimColor: true },
|
|
17
|
+
"Progress: ",
|
|
18
|
+
Math.round(progress),
|
|
19
|
+
"%")))));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=LoadingState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingState.js","sourceRoot":"","sources":["../../../src/tui/components/LoadingState.tsx"],"names":[],"mappings":";;;;;AAQA,oCAaC;AArBD,kDAA0B;AAC1B,6BAAgC;AAOhC,SAAgB,YAAY,CAAC,EAAE,OAAO,GAAG,YAAY,EAAE,QAAQ,EAAqB;IAClF,OAAO,CACL,8BAAC,SAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC;QACpC,8BAAC,SAAG;YACF,8BAAC,UAAI,IAAC,KAAK,EAAC,MAAM;;gBAAI,OAAO,CAAQ,CACjC;QACL,QAAQ,KAAK,SAAS,IAAI,CACzB,8BAAC,SAAG,IAAC,SAAS,EAAE,CAAC;YACf,8BAAC,UAAI,IAAC,QAAQ;;gBAAY,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;oBAAS,CACnD,CACP,CACG,CACP,CAAC;AACJ,CAAC"}
|