@camstack/system 1.2.129 → 1.2.130
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.
|
Binary file
|
|
Binary file
|
|
@@ -25,11 +25,21 @@
|
|
|
25
25
|
* caller runs it ONCE, well after boot, off the critical path — never on the
|
|
26
26
|
* path a config read waits behind.
|
|
27
27
|
*/
|
|
28
|
-
/**
|
|
28
|
+
/** What kind of object a `dbstat` group is. An index is an object too. */
|
|
29
|
+
export type SqliteObjectKind = 'table' | 'index' | 'unknown';
|
|
30
|
+
/** One `dbstat` group: an object and the space it occupies. */
|
|
29
31
|
export interface TableSizeRow {
|
|
30
32
|
readonly name: string;
|
|
33
|
+
/**
|
|
34
|
+
* `sqlite_master.tbl_name` — for a table this IS the table, for an index it
|
|
35
|
+
* is the table the index belongs to. Ownership is read from the relation
|
|
36
|
+
* SQLite already stores; an index name carries none (`idx_b_outbox` only
|
|
37
|
+
* looks parseable, and `sqlite_autoindex_a:media_1` would parse to nonsense).
|
|
38
|
+
*/
|
|
39
|
+
readonly tableName: string;
|
|
31
40
|
readonly bytes: number;
|
|
32
41
|
readonly pages: number;
|
|
42
|
+
readonly kind: SqliteObjectKind;
|
|
33
43
|
}
|
|
34
44
|
/** One line of the report. */
|
|
35
45
|
export interface TableSizeEntry {
|
|
@@ -38,14 +48,27 @@ export interface TableSizeEntry {
|
|
|
38
48
|
readonly pages: number;
|
|
39
49
|
/** Share of the whole file, percent. 0 when the file size is unknown. */
|
|
40
50
|
readonly pct: number;
|
|
51
|
+
readonly kind: SqliteObjectKind;
|
|
52
|
+
}
|
|
53
|
+
/** Everything one addon prefix owns, tables and their indexes together. */
|
|
54
|
+
export interface OwnerRollup {
|
|
55
|
+
readonly owner: string;
|
|
56
|
+
readonly sizeMb: number;
|
|
57
|
+
readonly objects: number;
|
|
41
58
|
}
|
|
42
59
|
export interface TableSizeReport {
|
|
43
60
|
readonly tables: readonly TableSizeEntry[];
|
|
44
61
|
/** Megabytes held by everything below the cut. */
|
|
45
62
|
readonly otherMb: number;
|
|
46
|
-
/** How many
|
|
47
|
-
readonly
|
|
63
|
+
/** How many OBJECTS are behind `otherMb` — tables and indexes alike. */
|
|
64
|
+
readonly otherObjects: number;
|
|
65
|
+
readonly tableCount: number;
|
|
66
|
+
readonly indexCount: number;
|
|
67
|
+
/** Every owner, biggest first. */
|
|
68
|
+
readonly byOwner: readonly OwnerRollup[];
|
|
48
69
|
}
|
|
70
|
+
/** The label for anything that is not a per-addon scoped collection. */
|
|
71
|
+
export declare const UNSCOPED_OWNER = "(unscoped)";
|
|
49
72
|
/**
|
|
50
73
|
* Rank tables by the space they hold and keep the top `limit`.
|
|
51
74
|
*
|
|
@@ -66,5 +89,7 @@ export declare function summariseTableSizes(rows: readonly TableSizeRow[], total
|
|
|
66
89
|
export declare const STORAGE_REPORT_DELAY_MS = 60000;
|
|
67
90
|
/** Top-N tables named individually; the remainder is reported as a tail. */
|
|
68
91
|
export declare const STORAGE_REPORT_TOP_N = 10;
|
|
92
|
+
/** Owners named individually in the log line. */
|
|
93
|
+
export declare const STORAGE_REPORT_TOP_OWNERS = 15;
|
|
69
94
|
/** `dbstat` shape, narrowed without a cast. */
|
|
70
95
|
export declare function toTableSizeRow(value: unknown): TableSizeRow | null;
|