@trillboards/edge-sdk 0.2.264 → 0.2.265
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/dist/ConnectorStatusClient.d.ts +10 -0
- package/dist/ConnectorStatusClient.d.ts.map +1 -1
- package/dist/ConnectorStatusClient.js +9 -1
- package/dist/ConnectorStatusClient.js.map +1 -1
- package/dist/DurableVlmCandidateSpool.d.ts +39 -1
- package/dist/DurableVlmCandidateSpool.d.ts.map +1 -1
- package/dist/DurableVlmCandidateSpool.js +116 -23
- package/dist/DurableVlmCandidateSpool.js.map +1 -1
- package/dist/EdgeAgent.js +1 -1
- package/dist/connectorUpdate.d.ts +11 -0
- package/dist/connectorUpdate.d.ts.map +1 -1
- package/dist/connectorUpdate.js +42 -5
- package/dist/connectorUpdate.js.map +1 -1
- package/dist/diagnose.d.ts +1 -1
- package/dist/diagnose.js +1 -1
- package/dist/mainThreadStall.d.ts +91 -0
- package/dist/mainThreadStall.d.ts.map +1 -0
- package/dist/mainThreadStall.js +496 -0
- package/dist/mainThreadStall.js.map +1 -0
- package/dist/pipelineSwitches.d.ts +30 -1
- package/dist/pipelineSwitches.d.ts.map +1 -1
- package/dist/pipelineSwitches.js +33 -9
- package/dist/pipelineSwitches.js.map +1 -1
- package/dist/sensingRunMode.d.ts.map +1 -1
- package/dist/sensingRunMode.js +5 -0
- package/dist/sensingRunMode.js.map +1 -1
- package/package.json +1 -1
- package/retained/RetainedCaptureClient.cjs +19 -3
- package/retained/__tests__/archive-lifecycle.test.cjs +72 -0
- package/retained/__tests__/realtime-schedule.test.cjs +64 -2
- package/retained/__tests__/support/theft-builder.cjs +3 -2
- package/retained/manager.cjs +11 -1
|
@@ -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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.PENDING_MINUTES_FILE = exports.MAX_MINUTES_PER_REPORT = exports.MAX_PENDING_MINUTES = exports.STALL_PERSIST_AT_ONCE_MS = exports.STALL_SITE_MIN_MS = void 0;
|
|
37
|
+
exports.formatStallSite = formatStallSite;
|
|
38
|
+
exports.startMainThreadStallClock = startMainThreadStallClock;
|
|
39
|
+
exports.stopMainThreadStallClock = stopMainThreadStallClock;
|
|
40
|
+
exports.takeStallMinutesForReport = takeStallMinutesForReport;
|
|
41
|
+
exports.ackStallMinutes = ackStallMinutes;
|
|
42
|
+
exports.__stallStateForTests = __stallStateForTests;
|
|
43
|
+
exports.__tickMainThreadStallForTests = __tickMainThreadStallForTests;
|
|
44
|
+
/**
|
|
45
|
+
* Main-thread stall evidence, one record per box per minute (plan v7 W8): the `mainThread` block
|
|
46
|
+
* of the connector-status beacon, stored by the server as typed rows in ClickHouse
|
|
47
|
+
* `connector_main_thread_minutes`.
|
|
48
|
+
*
|
|
49
|
+
* WHY. On Nov 19 2026, 11:38:12-11:39:13Z, the Texas connector's main thread stopped for about
|
|
50
|
+
* 61 s: its profile polls went silent, the detector sat 92% idle (3 calls in 60.2 s), frame
|
|
51
|
+
* selection stopped and every alert camera went a minute without a look, while the camera
|
|
52
|
+
* recorders (separate ffmpeg processes) kept full rate. The box's data could not separate the two
|
|
53
|
+
* candidate causes: a synchronous file call held by a disk flush or the antivirus scanner (the run
|
|
54
|
+
* path makes about 75 flushed writes and 49 deletes a second on 7 watched cameras, all on the main
|
|
55
|
+
* thread), or garbage collection near the heap limit.
|
|
56
|
+
*
|
|
57
|
+
* WHAT. Per wall-clock minute (box clock):
|
|
58
|
+
* - `loopMaxMs` / `loopMaxAtMs`: the event loop's longest delay that ended in the minute (how
|
|
59
|
+
* late a 100-ms interval timer ran; under ~16 ms is the Windows timer's own granularity) and
|
|
60
|
+
* when it ended, so it began `loopMaxMs` before;
|
|
61
|
+
* - `fsync`: the fsyncSync / fdatasyncSync calls that returned in the minute, their total ms,
|
|
62
|
+
* and the slowest one: its ms, when it returned and, at 50 ms or more, its two calling frames
|
|
63
|
+
* (function@file:line, file names only);
|
|
64
|
+
* - `file`: the same for every other synchronous fs call (open, write, close, rename, unlink,
|
|
65
|
+
* stat, readdir, read...), with the slowest call's fs function in `maxOp`;
|
|
66
|
+
* - `heapMaxMb`: the most V8 heap in use at a once-a-second sample; `heapLimitMb` beside them.
|
|
67
|
+
* A freeze then names its cause: a ~60-s loop delay matched by an fsync or file call of the same
|
|
68
|
+
* length names the call and its caller; with neither, the heap against its limit says whether
|
|
69
|
+
* garbage collection held the thread. And the lean archive's effect (CCTV_CAPTURE_ARCHIVE) shows
|
|
70
|
+
* on its own: fewer fsyncs and less fsync time a minute.
|
|
71
|
+
*
|
|
72
|
+
* EACH MINUTE ONCE, KEPT ON DISK UNTIL THE SERVER HAS IT. A closed minute joins the pending list
|
|
73
|
+
* in `<dataDir>/main-thread-minutes.json` (a day at most, oldest dropped first), with the minute
|
|
74
|
+
* in progress beside it; the file is rewritten when a minute closes and at once (at most every
|
|
75
|
+
* 5 s) after a loop delay or synchronous call of 1 s or more, so a freeze is on disk the moment the
|
|
76
|
+
* thread resumes. The next beacon carries the oldest pending minutes (120 at most) and the server's
|
|
77
|
+
* answer removes them; a beacon the server did not answer leaves them for the next. A new process
|
|
78
|
+
* starts from the file: the minutes before a crash or kill go on its first beacon, and the minute
|
|
79
|
+
* that was in progress is merged into the new process's record of the same minute or kept as its
|
|
80
|
+
* own. A normal exit writes the minute in progress.
|
|
81
|
+
*
|
|
82
|
+
* HOW FS IS TIMED. Every synchronous function of the shared `fs` module object
|
|
83
|
+
* (`require('fs')` and `require('node:fs')` are one object) is wrapped once, in place, so every
|
|
84
|
+
* caller that looks the function up when it calls it is timed: the archive, spool, lifecycle,
|
|
85
|
+
* journal and sequence stores here, and dependencies. A wrapper calls the original with the same
|
|
86
|
+
* `this` and arguments and returns or throws exactly what it does; the original's own properties
|
|
87
|
+
* (`realpathSync.native`) are copied. A call made inside another timed call (Node's writeFileSync
|
|
88
|
+
* calls the public fs.writeSync) is the outer call's time, counted once; the clock's own file and
|
|
89
|
+
* a slow call's stack formatting run untimed. A module that destructured an fs function before the
|
|
90
|
+
* clock started keeps the untimed original. Stopping restores every original still in place.
|
|
91
|
+
*
|
|
92
|
+
* COST. One timer callback per 100 ms, a heap read per second, two clock reads per synchronous fs
|
|
93
|
+
* call, a stack capture only for a call that took 50 ms or more and is the minute's slowest, and
|
|
94
|
+
* one small file write a minute.
|
|
95
|
+
*
|
|
96
|
+
* Started once per process by the run mode (`buildConfiguredLocalSensingManager`); diagnostics
|
|
97
|
+
* never throw into the caller.
|
|
98
|
+
*/
|
|
99
|
+
const fs = __importStar(require("fs"));
|
|
100
|
+
const path = __importStar(require("path"));
|
|
101
|
+
const v8 = __importStar(require("v8"));
|
|
102
|
+
const perf_hooks_1 = require("perf_hooks");
|
|
103
|
+
const TICK_MS = 100;
|
|
104
|
+
const HEAP_EVERY_TICKS = 10;
|
|
105
|
+
/** A call this slow (ms) that is the minute's slowest records where it came from. */
|
|
106
|
+
exports.STALL_SITE_MIN_MS = 50;
|
|
107
|
+
/** A loop delay or synchronous call this long (ms) is written to disk at once. */
|
|
108
|
+
exports.STALL_PERSIST_AT_ONCE_MS = 1000;
|
|
109
|
+
const PERSIST_AT_ONCE_GAP_MS = 5000;
|
|
110
|
+
/** The most closed minutes kept waiting for the server: a day. */
|
|
111
|
+
exports.MAX_PENDING_MINUTES = 1440;
|
|
112
|
+
/** The most minutes one beacon carries. */
|
|
113
|
+
exports.MAX_MINUTES_PER_REPORT = 120;
|
|
114
|
+
exports.PENDING_MINUTES_FILE = 'main-thread-minutes.json';
|
|
115
|
+
const SITE_MAX_CHARS = 120;
|
|
116
|
+
const FSYNC_OPS = new Set(['fsyncSync', 'fdatasyncSync']);
|
|
117
|
+
const MB = 1024 * 1024;
|
|
118
|
+
let clock = null;
|
|
119
|
+
let timer = null;
|
|
120
|
+
let lastTickAt = 0;
|
|
121
|
+
let ticks = 0;
|
|
122
|
+
let heapLimitMb = null;
|
|
123
|
+
let current = null;
|
|
124
|
+
/** Closed minutes the server has not acknowledged, oldest first. */
|
|
125
|
+
let pending = [];
|
|
126
|
+
let lastPersistAt = Number.NEGATIVE_INFINITY;
|
|
127
|
+
/** Writes the minute in progress when the process exits normally; removed on stop. */
|
|
128
|
+
let onExit = null;
|
|
129
|
+
/** fs function name → the original and the wrapper put in its place. */
|
|
130
|
+
const wrapped = new Map();
|
|
131
|
+
/** True while the clock does its own fs work or formats a slow call's stack: fs calls run untimed. */
|
|
132
|
+
let untimed = false;
|
|
133
|
+
/**
|
|
134
|
+
* Timed fs calls in progress. A call made inside another (Node's writeFileSync calls the public
|
|
135
|
+
* fs.writeSync) runs untimed: its time is the outer call's, counted once.
|
|
136
|
+
*/
|
|
137
|
+
let depth = 0;
|
|
138
|
+
const round1 = (value) => Math.round(value * 10) / 10;
|
|
139
|
+
function noCalls() {
|
|
140
|
+
return { n: 0, ms: 0, maxMs: 0, maxOp: null, maxAtMs: null, maxSite: null };
|
|
141
|
+
}
|
|
142
|
+
function newMinute(start) {
|
|
143
|
+
return { minute: start, loopMaxMs: 0, loopMaxAtMs: null, fsync: noCalls(), file: noCalls(), heapMaxMb: null };
|
|
144
|
+
}
|
|
145
|
+
function keepPending() {
|
|
146
|
+
if (pending.length > exports.MAX_PENDING_MINUTES)
|
|
147
|
+
pending.splice(0, pending.length - exports.MAX_PENDING_MINUTES);
|
|
148
|
+
}
|
|
149
|
+
/** The record of the minute holding `wallMs`; a minute that closes joins the pending list and the file. */
|
|
150
|
+
function minuteAt(wallMs) {
|
|
151
|
+
const start = Math.floor(wallMs / 60000) * 60000;
|
|
152
|
+
if (current && current.minute === start)
|
|
153
|
+
return current;
|
|
154
|
+
const closing = current;
|
|
155
|
+
current = newMinute(start);
|
|
156
|
+
if (closing) {
|
|
157
|
+
pending.push(closing);
|
|
158
|
+
keepPending();
|
|
159
|
+
persist();
|
|
160
|
+
}
|
|
161
|
+
return current;
|
|
162
|
+
}
|
|
163
|
+
/** Write the pending minutes and the minute in progress (tmp, flush, rename), untimed. Never throws. */
|
|
164
|
+
function persist() {
|
|
165
|
+
const c = clock;
|
|
166
|
+
if (!c || !c.pendingFile)
|
|
167
|
+
return;
|
|
168
|
+
untimed = true;
|
|
169
|
+
try {
|
|
170
|
+
const tmp = `${c.pendingFile}.tmp`;
|
|
171
|
+
const fd = fs.openSync(tmp, 'w');
|
|
172
|
+
try {
|
|
173
|
+
fs.writeFileSync(fd, JSON.stringify({ version: 1, heapLimitMb, pending, current }));
|
|
174
|
+
fs.fsyncSync(fd);
|
|
175
|
+
}
|
|
176
|
+
finally {
|
|
177
|
+
fs.closeSync(fd);
|
|
178
|
+
}
|
|
179
|
+
fs.renameSync(tmp, c.pendingFile);
|
|
180
|
+
lastPersistAt = c.now();
|
|
181
|
+
}
|
|
182
|
+
catch { /* the evidence is best-effort */ }
|
|
183
|
+
finally {
|
|
184
|
+
untimed = false;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function persistIfSignificant(c, ms) {
|
|
188
|
+
if (ms >= exports.STALL_PERSIST_AT_ONCE_MS && c.now() - lastPersistAt >= PERSIST_AT_ONCE_GAP_MS)
|
|
189
|
+
persist();
|
|
190
|
+
}
|
|
191
|
+
function isCalls(value) {
|
|
192
|
+
const v = value;
|
|
193
|
+
return !!v && typeof v === 'object' && Number.isFinite(v.n) && Number.isFinite(v.ms) && Number.isFinite(v.maxMs);
|
|
194
|
+
}
|
|
195
|
+
function isMinute(value) {
|
|
196
|
+
const v = value;
|
|
197
|
+
return !!v && typeof v === 'object' && Number.isSafeInteger(v.minute) && v.minute % 60000 === 0
|
|
198
|
+
&& Number.isFinite(v.loopMaxMs) && isCalls(v.fsync) && isCalls(v.file);
|
|
199
|
+
}
|
|
200
|
+
function mergeCalls(into, from) {
|
|
201
|
+
into.n += from.n;
|
|
202
|
+
into.ms += from.ms;
|
|
203
|
+
if (from.maxOp !== null && (into.maxOp === null || from.maxMs > into.maxMs)) {
|
|
204
|
+
into.maxMs = from.maxMs;
|
|
205
|
+
into.maxOp = from.maxOp;
|
|
206
|
+
into.maxAtMs = from.maxAtMs;
|
|
207
|
+
into.maxSite = from.maxSite;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/** Fold a previous process's record of this minute into this process's. */
|
|
211
|
+
function mergeMinute(into, from) {
|
|
212
|
+
if (from.loopMaxAtMs !== null && (into.loopMaxAtMs === null || from.loopMaxMs > into.loopMaxMs)) {
|
|
213
|
+
into.loopMaxMs = from.loopMaxMs;
|
|
214
|
+
into.loopMaxAtMs = from.loopMaxAtMs;
|
|
215
|
+
}
|
|
216
|
+
mergeCalls(into.fsync, from.fsync);
|
|
217
|
+
mergeCalls(into.file, from.file);
|
|
218
|
+
if (from.heapMaxMb !== null && (into.heapMaxMb === null || from.heapMaxMb > into.heapMaxMb))
|
|
219
|
+
into.heapMaxMb = from.heapMaxMb;
|
|
220
|
+
}
|
|
221
|
+
/** What a previous process left in the file: its pending minutes and the minute it had in progress. */
|
|
222
|
+
function loadPending(file) {
|
|
223
|
+
untimed = true;
|
|
224
|
+
try {
|
|
225
|
+
const saved = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
226
|
+
if (!saved || saved.version !== 1 || !Array.isArray(saved.pending))
|
|
227
|
+
return null;
|
|
228
|
+
pending = saved.pending.filter(isMinute);
|
|
229
|
+
keepPending();
|
|
230
|
+
if (typeof saved.heapLimitMb === 'number' && Number.isFinite(saved.heapLimitMb))
|
|
231
|
+
heapLimitMb = saved.heapLimitMb;
|
|
232
|
+
return isMinute(saved.current) ? saved.current : null;
|
|
233
|
+
}
|
|
234
|
+
catch {
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
finally {
|
|
238
|
+
untimed = false;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
function sampleHeap(c, minute) {
|
|
242
|
+
const heap = c.heap();
|
|
243
|
+
if (!heap)
|
|
244
|
+
return;
|
|
245
|
+
const usedMb = round1(heap.usedBytes / MB);
|
|
246
|
+
if (minute.heapMaxMb === null || usedMb > minute.heapMaxMb)
|
|
247
|
+
minute.heapMaxMb = usedMb;
|
|
248
|
+
heapLimitMb = round1(heap.limitBytes / MB);
|
|
249
|
+
}
|
|
250
|
+
function tick() {
|
|
251
|
+
const c = clock;
|
|
252
|
+
if (!c)
|
|
253
|
+
return;
|
|
254
|
+
try {
|
|
255
|
+
const now = c.now();
|
|
256
|
+
const late = Math.max(0, now - lastTickAt - c.tickMs);
|
|
257
|
+
lastTickAt = now;
|
|
258
|
+
const wall = c.wall();
|
|
259
|
+
const minute = minuteAt(wall);
|
|
260
|
+
if (minute.loopMaxAtMs === null || late > minute.loopMaxMs) {
|
|
261
|
+
minute.loopMaxMs = late;
|
|
262
|
+
minute.loopMaxAtMs = wall;
|
|
263
|
+
}
|
|
264
|
+
ticks += 1;
|
|
265
|
+
if (ticks % HEAP_EVERY_TICKS === 0 || minute.heapMaxMb === null)
|
|
266
|
+
sampleHeap(c, minute);
|
|
267
|
+
persistIfSignificant(c, late);
|
|
268
|
+
}
|
|
269
|
+
catch { /* diagnostics never throw */ }
|
|
270
|
+
}
|
|
271
|
+
/** `function@file:line` of the first two frames below the wrapper, file names only. */
|
|
272
|
+
function formatStallSite(stack) {
|
|
273
|
+
const frames = [];
|
|
274
|
+
for (const line of stack.split('\n')) {
|
|
275
|
+
const m = /^\s*at (?:(.*?) \()?(.+?):(\d+):\d+\)?\s*$/.exec(line);
|
|
276
|
+
if (!m)
|
|
277
|
+
continue;
|
|
278
|
+
const file = m[2].split(/[\\/]/).pop() || m[2];
|
|
279
|
+
const fn = m[1] ? m[1].replace(/^(?:async |new )+/, '') : '';
|
|
280
|
+
frames.push(`${fn ? fn + '@' : ''}${file}:${m[3]}`);
|
|
281
|
+
if (frames.length === 2)
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
return frames.length ? frames.join(' < ').slice(0, SITE_MAX_CHARS) : null;
|
|
285
|
+
}
|
|
286
|
+
function siteOf(wrapper) {
|
|
287
|
+
untimed = true;
|
|
288
|
+
try {
|
|
289
|
+
const holder = {};
|
|
290
|
+
Error.captureStackTrace(holder, wrapper);
|
|
291
|
+
return formatStallSite(holder.stack ?? '');
|
|
292
|
+
}
|
|
293
|
+
catch {
|
|
294
|
+
return null;
|
|
295
|
+
}
|
|
296
|
+
finally {
|
|
297
|
+
untimed = false;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
function noteCall(c, op, ms, wrapper) {
|
|
301
|
+
const wall = c.wall();
|
|
302
|
+
const minute = minuteAt(wall);
|
|
303
|
+
const calls = FSYNC_OPS.has(op) ? minute.fsync : minute.file;
|
|
304
|
+
calls.n += 1;
|
|
305
|
+
calls.ms += ms;
|
|
306
|
+
if (calls.maxOp === null || ms > calls.maxMs) {
|
|
307
|
+
calls.maxMs = ms;
|
|
308
|
+
calls.maxOp = op;
|
|
309
|
+
calls.maxAtMs = wall;
|
|
310
|
+
calls.maxSite = ms >= exports.STALL_SITE_MIN_MS ? siteOf(wrapper) : null;
|
|
311
|
+
}
|
|
312
|
+
persistIfSignificant(c, ms);
|
|
313
|
+
}
|
|
314
|
+
function timedCopy(op, original) {
|
|
315
|
+
const wrapper = function (...args) {
|
|
316
|
+
const c = clock;
|
|
317
|
+
if (!c || untimed || depth > 0)
|
|
318
|
+
return original.apply(this, args);
|
|
319
|
+
let startedAt = 0;
|
|
320
|
+
try {
|
|
321
|
+
startedAt = c.now();
|
|
322
|
+
}
|
|
323
|
+
catch {
|
|
324
|
+
return original.apply(this, args);
|
|
325
|
+
}
|
|
326
|
+
depth += 1;
|
|
327
|
+
try {
|
|
328
|
+
return original.apply(this, args);
|
|
329
|
+
}
|
|
330
|
+
finally {
|
|
331
|
+
depth -= 1;
|
|
332
|
+
try {
|
|
333
|
+
noteCall(c, op, c.now() - startedAt, wrapper);
|
|
334
|
+
}
|
|
335
|
+
catch { /* diagnostics never throw */ }
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
for (const key of Object.keys(original)) {
|
|
339
|
+
wrapper[key] = original[key];
|
|
340
|
+
}
|
|
341
|
+
try {
|
|
342
|
+
Object.defineProperty(wrapper, 'name', { value: original.name, configurable: true });
|
|
343
|
+
}
|
|
344
|
+
catch { /* cosmetic */ }
|
|
345
|
+
return wrapper;
|
|
346
|
+
}
|
|
347
|
+
function defaultHeap() {
|
|
348
|
+
const stats = v8.getHeapStatistics();
|
|
349
|
+
return { usedBytes: stats.used_heap_size, limitBytes: stats.heap_size_limit };
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Start the clock: pick up what a previous process left, time every synchronous fs function in
|
|
353
|
+
* place and run the event-loop timer. Idempotent: a second start keeps the running clock.
|
|
354
|
+
* Returns the stop.
|
|
355
|
+
*/
|
|
356
|
+
function startMainThreadStallClock(options = {}) {
|
|
357
|
+
if (clock)
|
|
358
|
+
return stopMainThreadStallClock;
|
|
359
|
+
const c = {
|
|
360
|
+
now: options.now ?? (() => perf_hooks_1.performance.now()),
|
|
361
|
+
wall: options.wall ?? (() => Date.now()),
|
|
362
|
+
heap: options.heap ?? defaultHeap,
|
|
363
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
364
|
+
fsModule: options.fsModule ?? require('fs'),
|
|
365
|
+
tickMs: options.tickMs ?? TICK_MS,
|
|
366
|
+
pendingFile: options.dataDir ? path.join(options.dataDir, exports.PENDING_MINUTES_FILE) : null,
|
|
367
|
+
};
|
|
368
|
+
clock = c;
|
|
369
|
+
let previous = null;
|
|
370
|
+
if (c.pendingFile) {
|
|
371
|
+
untimed = true;
|
|
372
|
+
try {
|
|
373
|
+
fs.mkdirSync(path.dirname(c.pendingFile), { recursive: true });
|
|
374
|
+
}
|
|
375
|
+
catch { /* persist() retries the write */ }
|
|
376
|
+
untimed = false;
|
|
377
|
+
previous = loadPending(c.pendingFile);
|
|
378
|
+
}
|
|
379
|
+
try {
|
|
380
|
+
lastTickAt = c.now();
|
|
381
|
+
const minute = minuteAt(c.wall());
|
|
382
|
+
if (previous) {
|
|
383
|
+
if (previous.minute === minute.minute)
|
|
384
|
+
mergeMinute(minute, previous);
|
|
385
|
+
else {
|
|
386
|
+
pending.push(previous);
|
|
387
|
+
keepPending();
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
sampleHeap(c, minute);
|
|
391
|
+
}
|
|
392
|
+
catch { /* the first tick fills the minute */ }
|
|
393
|
+
for (const key of Object.keys(c.fsModule)) {
|
|
394
|
+
const original = c.fsModule[key];
|
|
395
|
+
if (typeof original !== 'function' || !key.endsWith('Sync') || wrapped.has(key))
|
|
396
|
+
continue;
|
|
397
|
+
const wrapper = timedCopy(key, original);
|
|
398
|
+
try {
|
|
399
|
+
c.fsModule[key] = wrapper;
|
|
400
|
+
wrapped.set(key, { original: original, wrapper });
|
|
401
|
+
}
|
|
402
|
+
catch { /* a read-only property stays untimed */ }
|
|
403
|
+
}
|
|
404
|
+
if (options.timer !== false) {
|
|
405
|
+
timer = setInterval(tick, c.tickMs);
|
|
406
|
+
timer.unref?.();
|
|
407
|
+
}
|
|
408
|
+
if (c.pendingFile) {
|
|
409
|
+
onExit = () => persist();
|
|
410
|
+
process.once('exit', onExit);
|
|
411
|
+
}
|
|
412
|
+
return stopMainThreadStallClock;
|
|
413
|
+
}
|
|
414
|
+
/** Stop the clock and put back every original fs function nothing else has replaced since. */
|
|
415
|
+
function stopMainThreadStallClock() {
|
|
416
|
+
if (timer)
|
|
417
|
+
clearInterval(timer);
|
|
418
|
+
timer = null;
|
|
419
|
+
if (onExit)
|
|
420
|
+
process.removeListener('exit', onExit);
|
|
421
|
+
onExit = null;
|
|
422
|
+
const c = clock;
|
|
423
|
+
if (c) {
|
|
424
|
+
for (const [key, { original, wrapper }] of wrapped) {
|
|
425
|
+
if (c.fsModule[key] === wrapper) {
|
|
426
|
+
try {
|
|
427
|
+
c.fsModule[key] = original;
|
|
428
|
+
}
|
|
429
|
+
catch { /* left wrapped; the wrapper passes through once stopped */ }
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
wrapped.clear();
|
|
434
|
+
clock = null;
|
|
435
|
+
current = null;
|
|
436
|
+
pending = [];
|
|
437
|
+
ticks = 0;
|
|
438
|
+
heapLimitMb = null;
|
|
439
|
+
lastPersistAt = Number.NEGATIVE_INFINITY;
|
|
440
|
+
untimed = false;
|
|
441
|
+
depth = 0;
|
|
442
|
+
}
|
|
443
|
+
function present(calls) {
|
|
444
|
+
return { ...calls, ms: round1(calls.ms), maxMs: round1(calls.maxMs) };
|
|
445
|
+
}
|
|
446
|
+
function presentMinute(m) {
|
|
447
|
+
return {
|
|
448
|
+
minute: m.minute,
|
|
449
|
+
loopMaxMs: round1(m.loopMaxMs),
|
|
450
|
+
loopMaxAtMs: m.loopMaxAtMs,
|
|
451
|
+
fsync: present(m.fsync),
|
|
452
|
+
file: present(m.file),
|
|
453
|
+
heapMaxMb: m.heapMaxMb,
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* The beacon's `mainThread` block: the oldest closed minutes the server has not acknowledged
|
|
458
|
+
* (at most `max`), or null with none or while the clock is not running.
|
|
459
|
+
*/
|
|
460
|
+
function takeStallMinutesForReport(max = exports.MAX_MINUTES_PER_REPORT) {
|
|
461
|
+
const c = clock;
|
|
462
|
+
if (!c)
|
|
463
|
+
return null;
|
|
464
|
+
try {
|
|
465
|
+
minuteAt(c.wall());
|
|
466
|
+
if (!pending.length)
|
|
467
|
+
return null;
|
|
468
|
+
return { version: 1, heapLimitMb, minutes: pending.slice(0, Math.max(1, max)).map(presentMinute) };
|
|
469
|
+
}
|
|
470
|
+
catch {
|
|
471
|
+
return null;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
/** The server stored (or refused) these minutes: drop them from the pending list and the file. */
|
|
475
|
+
function ackStallMinutes(minutes) {
|
|
476
|
+
if (!clock || !minutes.length)
|
|
477
|
+
return;
|
|
478
|
+
try {
|
|
479
|
+
for (const minute of minutes) {
|
|
480
|
+
const at = pending.findIndex((m) => m.minute === minute);
|
|
481
|
+
if (at >= 0)
|
|
482
|
+
pending.splice(at, 1);
|
|
483
|
+
}
|
|
484
|
+
persist();
|
|
485
|
+
}
|
|
486
|
+
catch { /* diagnostics never throw */ }
|
|
487
|
+
}
|
|
488
|
+
/** The pending minutes and the minute in progress, as the beacon would present them (tests). */
|
|
489
|
+
function __stallStateForTests() {
|
|
490
|
+
return { heapLimitMb, pending: pending.map(presentMinute), current: current ? presentMinute(current) : null };
|
|
491
|
+
}
|
|
492
|
+
/** Run one event-loop timer tick now (tests with `timer: false`). */
|
|
493
|
+
function __tickMainThreadStallForTests() {
|
|
494
|
+
tick();
|
|
495
|
+
}
|
|
496
|
+
//# sourceMappingURL=mainThreadStall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mainThreadStall.js","sourceRoot":"","sources":["../src/mainThreadStall.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqSA,0CAWC;AA6DD,8DA8CC;AAGD,4DAsBC;AAqBD,8DAUC;AAGD,0CASC;AAGD,oDAEC;AAGD,sEAEC;AAzeD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AACzB,2CAAyC;AA2DzC,MAAM,OAAO,GAAG,GAAG,CAAC;AACpB,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,qFAAqF;AACxE,QAAA,iBAAiB,GAAG,EAAE,CAAC;AACpC,kFAAkF;AACrE,QAAA,wBAAwB,GAAG,IAAI,CAAC;AAC7C,MAAM,sBAAsB,GAAG,IAAI,CAAC;AACpC,kEAAkE;AACrD,QAAA,mBAAmB,GAAG,IAAI,CAAC;AACxC,2CAA2C;AAC9B,QAAA,sBAAsB,GAAG,GAAG,CAAC;AAC7B,QAAA,oBAAoB,GAAG,0BAA0B,CAAC;AAC/D,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC;AAC1D,MAAM,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAWvB,IAAI,KAAK,GAAiB,IAAI,CAAC;AAC/B,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AE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;IACrG,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,kGAAkG;AAClG,SAAgB,eAAe,CAAC,OAA0B;IACxD,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM;QAAE,OAAO;IACtC,IAAI,CAAC;QACH,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;YACzD,IAAI,EAAE,IAAI,CAAC;gBAAE,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;IAAC,MAAM,CAAC,CAAC,6BAA6B,CAAC,CAAC;AAC3C,CAAC;AAED,gGAAgG;AAChG,SAAgB,oBAAoB;IAClC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAChH,CAAC;AAED,qEAAqE;AACrE,SAAgB,6BAA6B;IAC3C,IAAI,EAAE,CAAC;AACT,CAAC"}
|
|
@@ -1,17 +1,39 @@
|
|
|
1
1
|
export type CapturePipeline = 'legacy' | 'select_first' | 'select_first_hw' | 'keyframes' | 'keyframes_hw';
|
|
2
2
|
export type LookReuseMode = 'off' | 'shadow' | 'live';
|
|
3
3
|
export type DetectorBackendMode = 'ort' | 'openvino_probe' | 'openvino' | 'openvino_gpu';
|
|
4
|
+
/**
|
|
5
|
+
* What a watched camera's capture writes to disk (CCTV_CAPTURE_ARCHIVE).
|
|
6
|
+
*
|
|
7
|
+
* `legacy` (today): every capture's queue copy is written to the spool, JPEG and
|
|
8
|
+
* record each flushed to disk, and the archive retires its ten-minute-old
|
|
9
|
+
* captures on every capture, two flushed lifecycle commits each time. Measured
|
|
10
|
+
* on 7 watched cameras (13.1 captures/s, rig 2026-11-19): 75 flushed writes and
|
|
11
|
+
* 49 deletes a second; 9.2 of the 10.5 spool copies written a second were
|
|
12
|
+
* deleted unreviewed half a second later (p50 0.53 s), superseded by the
|
|
13
|
+
* camera's next capture.
|
|
14
|
+
*
|
|
15
|
+
* `lean`: the same captures, selections, looks and answers. A queue copy of an
|
|
16
|
+
* archived capture stays in memory until a review takes it (the archive already
|
|
17
|
+
* holds that capture durably and re-offers it after a restart), and each
|
|
18
|
+
* camera retires its old captures at most once every 30 s, in one batch.
|
|
19
|
+
*/
|
|
20
|
+
export type ArchiveMode = 'legacy' | 'lean';
|
|
4
21
|
export interface PipelineSwitches {
|
|
5
22
|
version: 1;
|
|
6
23
|
capture: CapturePipeline;
|
|
7
24
|
lookReuse: LookReuseMode;
|
|
8
25
|
detectorBackend: DetectorBackendMode;
|
|
26
|
+
archive: ArchiveMode;
|
|
9
27
|
}
|
|
10
28
|
export declare const CAPTURE_PIPELINES: readonly CapturePipeline[];
|
|
11
29
|
export declare const LOOK_REUSE_MODES: readonly LookReuseMode[];
|
|
12
30
|
export declare const DETECTOR_BACKENDS: readonly DetectorBackendMode[];
|
|
31
|
+
export declare const ARCHIVE_MODES: readonly ArchiveMode[];
|
|
13
32
|
export declare const DEFAULT_PIPELINE_SWITCHES: Readonly<PipelineSwitches>;
|
|
14
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Strictly read a `pipeline` body; null when any part is unusable (the box keeps what it has).
|
|
35
|
+
* `archive` is the one optional key: absent (a server before it) is `legacy`.
|
|
36
|
+
*/
|
|
15
37
|
export declare function parsePipelineSwitches(raw: unknown): PipelineSwitches | null;
|
|
16
38
|
type Listener = (switches: PipelineSwitches) => void;
|
|
17
39
|
/**
|
|
@@ -51,6 +73,13 @@ export interface DetectorBackendSnapshot {
|
|
|
51
73
|
sampledAtMs: number;
|
|
52
74
|
}
|
|
53
75
|
export declare function noteDetectorBackend(snapshot: DetectorBackendSnapshot | null): void;
|
|
76
|
+
/**
|
|
77
|
+
* The lean archive's box-wide counters for this run (CCTV_CAPTURE_ARCHIVE): queue copies held in
|
|
78
|
+
* memory now, ever, and that left without being written. Bound by the website manager to its
|
|
79
|
+
* spool; absent while nothing is bound.
|
|
80
|
+
*/
|
|
81
|
+
type ArchiveStatsReader = () => Record<string, number> | null;
|
|
82
|
+
export declare function bindArchiveStats(reader: ArchiveStatsReader | null): void;
|
|
54
83
|
export declare function noteServerClock(sentAtMs: number, receivedAtMs: number, serverNowMs: unknown): void;
|
|
55
84
|
/** What a look reports about the pipeline that produced it. Bounded and diagnostic. */
|
|
56
85
|
export declare function pipelineTrace(feedName: string | undefined, lookReuse?: unknown): Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipelineSwitches.d.ts","sourceRoot":"","sources":["../src/pipelineSwitches.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pipelineSwitches.d.ts","sourceRoot":"","sources":["../src/pipelineSwitches.ts"],"names":[],"mappings":"AA0BA,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,cAAc,GAAG,iBAAiB,GAAG,WAAW,GAAG,cAAc,CAAC;AAC3G,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AACtD,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,gBAAgB,GAAG,UAAU,GAAG,cAAc,CAAC;AACzF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE5C,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,CAAC,CAAC;IACX,OAAO,EAAE,eAAe,CAAC;IACzB,SAAS,EAAE,aAAa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