@obzerver/server 0.15.0 → 0.16.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/dist/alerts.js +9 -3
- package/dist/alerts.js.map +1 -1
- package/dist/checkpoint.d.ts +9 -0
- package/dist/checkpoint.js +65 -12
- package/dist/checkpoint.js.map +1 -1
- package/dist/cli.js +3 -1
- package/dist/cli.js.map +1 -1
- package/dist/db.d.ts +28 -2
- package/dist/db.js +136 -9
- package/dist/db.js.map +1 -1
- package/dist/history.js +3 -2
- package/dist/history.js.map +1 -1
- package/dist/ingest.d.ts +1 -1
- package/dist/ingest.js +77 -1
- package/dist/ingest.js.map +1 -1
- package/dist/ingestqueue.d.ts +2 -0
- package/dist/ingestqueue.js +20 -2
- package/dist/ingestqueue.js.map +1 -1
- package/dist/mathutil.d.ts +3 -0
- package/dist/mathutil.js +4 -0
- package/dist/mathutil.js.map +1 -0
- package/dist/queries.d.ts +69 -0
- package/dist/queries.js +407 -79
- package/dist/queries.js.map +1 -1
- package/dist/reader.d.ts +34 -0
- package/dist/reader.js +104 -0
- package/dist/reader.js.map +1 -0
- package/dist/readworker.d.ts +32 -0
- package/dist/readworker.js +35 -0
- package/dist/readworker.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.js +48 -34
- package/dist/server.js.map +1 -1
- package/dist/usage.js +20 -6
- package/dist/usage.js.map +1 -1
- package/package.json +3 -3
- package/public/assets/{index-lWLgVxWi.js → index-CW1YpnVk.js} +1 -1
- package/public/index.html +1 -1
package/dist/mathutil.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Math.max / Math.min over a list of any length: spreading a long list into them overflows the call stack. */
|
|
2
|
+
export const maxOf = (arr) => arr.reduce((a, b) => (b > a ? b : a), -Infinity);
|
|
3
|
+
export const minOf = (arr) => arr.reduce((a, b) => (b < a ? b : a), Infinity);
|
|
4
|
+
//# sourceMappingURL=mathutil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mathutil.js","sourceRoot":"","sources":["../src/mathutil.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAa,EAAU,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;AACjG,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAa,EAAU,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC"}
|
package/dist/queries.d.ts
CHANGED
|
@@ -218,6 +218,75 @@ export declare function bucketFor(from: number, to: number, target?: number): nu
|
|
|
218
218
|
export declare function percentile(sorted: number[], p: number): number | null;
|
|
219
219
|
/** Normalise the common window params. */
|
|
220
220
|
export declare function windowOf(q?: WindowQuery): Window;
|
|
221
|
+
/**
|
|
222
|
+
* A window's rows as columns. SQLite reads them in one pass over the `traces_window` index (which holds every
|
|
223
|
+
* column used here, so no table row is touched) and hands each column over as one JSON array; JavaScript
|
|
224
|
+
* keeps them in typed arrays: ~25 bytes a row instead of an object per row.
|
|
225
|
+
*/
|
|
226
|
+
export interface Columns {
|
|
227
|
+
n: number;
|
|
228
|
+
ts: Float64Array;
|
|
229
|
+
d: Float64Array;
|
|
230
|
+
failed: Uint8Array;
|
|
231
|
+
/** HTTP status, -1 where there is none. */
|
|
232
|
+
status: Int32Array;
|
|
233
|
+
/** Queue wait (jobs), NaN where there is none. */
|
|
234
|
+
qw: Float64Array | null;
|
|
235
|
+
/** Which operation (service and name) each row is, as an index into `ops`. */
|
|
236
|
+
op: Int32Array | null;
|
|
237
|
+
ops: Array<{
|
|
238
|
+
service: string;
|
|
239
|
+
name: string;
|
|
240
|
+
}>;
|
|
241
|
+
}
|
|
242
|
+
export declare function readColumns(db: Db, where: string, args: Array<string | number>, { ops, queueWait, index }?: {
|
|
243
|
+
ops?: boolean | undefined;
|
|
244
|
+
queueWait?: boolean | undefined;
|
|
245
|
+
index?: boolean | undefined;
|
|
246
|
+
}): Columns;
|
|
247
|
+
/**
|
|
248
|
+
* A window is read as 5-minute slots. A slot that lies wholly inside the window is kept in memory after it is
|
|
249
|
+
* read, together with the slot's write mark (`slot_marks`, bumped by ingest and retention whenever a row in
|
|
250
|
+
* that slot is written or deleted); the next read reuses it while the mark is unchanged. Only the window's
|
|
251
|
+
* partial first slot, its open last slot and slots that changed are read from SQLite again. The numbers are
|
|
252
|
+
* computed from the same rows as before, so they stay exact; the cache only saves reading them.
|
|
253
|
+
*/
|
|
254
|
+
export declare const SLOT = 300000;
|
|
255
|
+
export declare const cacheStats: {
|
|
256
|
+
hits: number;
|
|
257
|
+
misses: number;
|
|
258
|
+
evicted: number;
|
|
259
|
+
readonly bytes: number;
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* The window's rows as columns: `base` filters (no time condition) and the time range is [from, to], both ends
|
|
263
|
+
* included. Same rows, same numbers as `readColumns` over the whole window.
|
|
264
|
+
*/
|
|
265
|
+
export declare function readWindow(db: Db, base: string, args: Array<string | number>, from: number, to: number, opts?: {
|
|
266
|
+
ops?: boolean;
|
|
267
|
+
queueWait?: boolean;
|
|
268
|
+
}): Columns;
|
|
269
|
+
/** One group's numbers: exact counts, sums and percentiles of the measured value. */
|
|
270
|
+
export interface Agg {
|
|
271
|
+
calls: number;
|
|
272
|
+
failed: number;
|
|
273
|
+
s4xx: number;
|
|
274
|
+
s5xx: number;
|
|
275
|
+
/** Microseconds, summed as integers: exact, with no floating-point drift. */
|
|
276
|
+
total: number;
|
|
277
|
+
max: number | null;
|
|
278
|
+
last: number | null;
|
|
279
|
+
p50: number | null;
|
|
280
|
+
p95: number | null;
|
|
281
|
+
p99: number | null;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Exact statistics per group: each group's values are laid out next to each other (a counting sort, O(n))
|
|
285
|
+
* and each group's run is sorted on its own, natively, as a Float64Array. Percentiles are nearest-rank, the
|
|
286
|
+
* definition `percentile` uses: the ceil(p·n/100)-th smallest value.
|
|
287
|
+
* `groupOf(i)` is the group of row i, or -1 to leave the row out. Rows without a value (NaN) are left out.
|
|
288
|
+
*/
|
|
289
|
+
export declare function groupAgg(c: Columns, groups: number, groupOf: (i: number) => number, value?: Float64Array): Agg[];
|
|
221
290
|
export declare function meta(db: Db): {
|
|
222
291
|
version: string;
|
|
223
292
|
services: {
|