@camstack/system 1.2.130 → 1.2.131
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/builtins/sqlite-storage/query-profiler.d.ts +11 -1
- package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +20 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
- package/package.json +1 -1
|
@@ -62,11 +62,14 @@ export interface SqliteOpSample {
|
|
|
62
62
|
* asked per-camera, and a line without the tag cannot answer it.
|
|
63
63
|
*/
|
|
64
64
|
readonly deviceId?: number;
|
|
65
|
+
/** See {@link SqliteOpLabel.owner}. */
|
|
66
|
+
readonly owner?: string;
|
|
65
67
|
}
|
|
66
|
-
/** One `(op, collection)`
|
|
68
|
+
/** One `(op, collection, owner)` triple's totals over a report window. */
|
|
67
69
|
export interface SqliteOpStat {
|
|
68
70
|
readonly op: string;
|
|
69
71
|
readonly collection: string;
|
|
72
|
+
readonly owner?: string;
|
|
70
73
|
readonly calls: number;
|
|
71
74
|
readonly totalMs: number;
|
|
72
75
|
readonly maxMs: number;
|
|
@@ -107,6 +110,13 @@ export interface SqliteOpLabel {
|
|
|
107
110
|
readonly op: string;
|
|
108
111
|
readonly collection: string;
|
|
109
112
|
readonly deviceId?: number;
|
|
113
|
+
/**
|
|
114
|
+
* The addon a scoped row belongs to, when the filter named one (see
|
|
115
|
+
* `scopeOwnerOf`). Part of the aggregate KEY, not decoration: without it the
|
|
116
|
+
* report can say a collection is being hammered and never by whom, which is
|
|
117
|
+
* exactly where the 67 660-call storm of 2026-08-25 stopped.
|
|
118
|
+
*/
|
|
119
|
+
readonly owner?: string;
|
|
110
120
|
}
|
|
111
121
|
export declare class SqliteOpProfiler {
|
|
112
122
|
private readonly logger;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CollectionColumn, CollectionIndex, DataStoreEngineInfo, HistogramBucket, IScopedLogger, ISettingsBackend, SettingsCountInput, SettingsDeleteInput, SettingsGetInput, SettingsHistogramInput, SettingsInsertInput, SettingsIsEmptyInput, SettingsQueryInput, SettingsRecord, SettingsSetInput, SettingsUpdateInput } from '@camstack/types';
|
|
1
|
+
import { CollectionColumn, CollectionIndex, DataStoreEngineInfo, HistogramBucket, IScopedLogger, ISettingsBackend, QueryFilter, SettingsCountInput, SettingsDeleteInput, SettingsGetInput, SettingsHistogramInput, SettingsInsertInput, SettingsIsEmptyInput, SettingsQueryInput, SettingsRecord, SettingsSetInput, SettingsUpdateInput } from '@camstack/types';
|
|
2
2
|
import { default as Database } from 'better-sqlite3';
|
|
3
3
|
import { MutationFilterInput } from './filter-compiler.js';
|
|
4
4
|
import { SqliteOpProfiler } from './query-profiler.js';
|
|
@@ -26,6 +26,25 @@ export interface DroppedTable {
|
|
|
26
26
|
/** Rows the table held at the moment it was dropped. */
|
|
27
27
|
readonly rows: number;
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* The addon that owns a scoped row, lifted out of the filter that names it.
|
|
31
|
+
*
|
|
32
|
+
* `(op, collection)` cannot name a culprit: the 60 s window of 2026-08-25 read
|
|
33
|
+
* `query addon-device-settings` 67 660 times — 1 128 a second on a
|
|
34
|
+
* single-threaded synchronous engine — and the report could say what was
|
|
35
|
+
* running but never who. The caller identity is not reachable from this
|
|
36
|
+
* process (a cap handler receives an input, not a caller), but for the scoped
|
|
37
|
+
* collections it does not need to be: the id IS `<addonId>:<deviceId>.<field>`,
|
|
38
|
+
* so a filter that names an id names its owner.
|
|
39
|
+
*
|
|
40
|
+
* Attributes NOTHING when the id is unscoped or absent. A storm blamed on the
|
|
41
|
+
* wrong addon is worse than one with no name on it — the wrong name gets acted
|
|
42
|
+
* on. Same source and same shape as {@link deviceIdOf}, which already lifts the
|
|
43
|
+
* device out of this very filter.
|
|
44
|
+
*/
|
|
45
|
+
export declare function scopeOwnerOf(filter: QueryFilter | undefined): {
|
|
46
|
+
owner?: string;
|
|
47
|
+
};
|
|
29
48
|
/**
|
|
30
49
|
* SQLite implementation of ISettingsBackend.
|
|
31
50
|
*
|
|
Binary file
|
|
Binary file
|