@hot-updater/plugin-insights 1.0.0-rc.30 → 1.0.0-rc.32
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/server/contract.cjs +13 -32
- package/dist/server/contract.mjs +13 -32
- package/dist/server/index.cjs +3 -29
- package/dist/server/index.d.cts +6 -72
- package/dist/server/index.d.mts +6 -72
- package/dist/server/index.mjs +4 -30
- package/dist/server/model.cjs +2 -2
- package/dist/server/model.mjs +2 -2
- package/dist/server/modelTypes.d.cts +28 -51
- package/dist/server/modelTypes.d.mts +28 -51
- package/dist/server/overview.cjs +6 -10
- package/dist/server/overview.mjs +6 -10
- package/dist/server/reads.cjs +34 -104
- package/dist/server/reads.mjs +34 -104
- package/dist/server/recordEvent.cjs +9 -60
- package/dist/server/recordEvent.mjs +9 -60
- package/dist/server/schema.cjs +9 -87
- package/dist/server/schema.d.cts +4 -136
- package/dist/server/schema.d.mts +4 -136
- package/dist/server/schema.mjs +9 -87
- package/package.json +5 -5
package/dist/server/schema.mjs
CHANGED
|
@@ -92,14 +92,6 @@ const bundleEvents = (days) => defineTable({
|
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
indexes: {
|
|
95
|
-
recent: {
|
|
96
|
-
eq: [
|
|
97
|
-
"channel",
|
|
98
|
-
"platform",
|
|
99
|
-
"day"
|
|
100
|
-
],
|
|
101
|
-
sort: ["received_at_ms"]
|
|
102
|
-
},
|
|
103
95
|
movementsByInstall: {
|
|
104
96
|
eq: ["movement_install_id"],
|
|
105
97
|
sort: ["received_at_ms"]
|
|
@@ -216,10 +208,11 @@ const window = {
|
|
|
216
208
|
};
|
|
217
209
|
/**
|
|
218
210
|
* Counters of one period kind: hourly, daily, or lifetime at bucket 0. A
|
|
219
|
-
* release or channel row counts downloads
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
211
|
+
* release or channel row counts downloads and failed launches, and downloads
|
|
212
|
+
* a patch delivered and those that fell back from one. Only a release's
|
|
213
|
+
* lifetime row counts launches, which the bundle list reads and no windowed
|
|
214
|
+
* read sums. It also counts the release's failed updates (`failed_updates`),
|
|
215
|
+
* since no breakdown row outlives the raw period; windowed reads sum
|
|
223
216
|
* `insights_failures` instead.
|
|
224
217
|
*/
|
|
225
218
|
const counters = (retention) => defineAggregate(identityFields, {
|
|
@@ -238,17 +231,13 @@ const counters = (retention) => defineAggregate(identityFields, {
|
|
|
238
231
|
...retention === void 0 ? {} : { retention }
|
|
239
232
|
});
|
|
240
233
|
/**
|
|
241
|
-
* Unique-installation sketches of one period kind
|
|
242
|
-
*
|
|
243
|
-
*
|
|
234
|
+
* Unique-installation sketches of one period kind: a usage row's active
|
|
235
|
+
* installations (`activity_users`), and a `failure` or `check` row's
|
|
236
|
+
* installations whose update or update check failed (`failed_users`).
|
|
244
237
|
*/
|
|
245
238
|
const sketches = (retention) => defineAggregate(identityFields, {
|
|
246
239
|
key: ["identity", "bucket_start_ms"],
|
|
247
|
-
distinct: [
|
|
248
|
-
"launch_users",
|
|
249
|
-
"activity_users",
|
|
250
|
-
"failed_users"
|
|
251
|
-
],
|
|
240
|
+
distinct: ["activity_users", "failed_users"],
|
|
252
241
|
shards: SKETCH_SHARDS,
|
|
253
242
|
batched: true,
|
|
254
243
|
indexes: { window },
|
|
@@ -354,71 +343,6 @@ const insightsDistribution = (retention) => defineAggregate({
|
|
|
354
343
|
},
|
|
355
344
|
retention
|
|
356
345
|
});
|
|
357
|
-
/** The last running bundle observed per installation and UTC day. */
|
|
358
|
-
const bundleDailyHeads = (retention) => defineTable({
|
|
359
|
-
install_id: {
|
|
360
|
-
type: "string",
|
|
361
|
-
maxLength: 255
|
|
362
|
-
},
|
|
363
|
-
bucket_start_ms: { type: "integer" },
|
|
364
|
-
id: {
|
|
365
|
-
type: "string",
|
|
366
|
-
maxLength: 36
|
|
367
|
-
},
|
|
368
|
-
received_at_ms: { type: "integer" },
|
|
369
|
-
channel: { type: "string" },
|
|
370
|
-
platform: {
|
|
371
|
-
type: "string",
|
|
372
|
-
maxLength: 16
|
|
373
|
-
},
|
|
374
|
-
app_version: { type: "string" },
|
|
375
|
-
release_id: {
|
|
376
|
-
type: "string",
|
|
377
|
-
maxLength: 36
|
|
378
|
-
},
|
|
379
|
-
bundle_kind: {
|
|
380
|
-
type: "string",
|
|
381
|
-
maxLength: 16
|
|
382
|
-
}
|
|
383
|
-
}, {
|
|
384
|
-
key: ["install_id", "bucket_start_ms"],
|
|
385
|
-
retention
|
|
386
|
-
});
|
|
387
|
-
/** Daily observations stay in their day when an installation reports again. */
|
|
388
|
-
const insightsDistributionHistory = (retention) => defineAggregate({
|
|
389
|
-
channel: { type: "string" },
|
|
390
|
-
platform: {
|
|
391
|
-
type: "string",
|
|
392
|
-
maxLength: 16
|
|
393
|
-
},
|
|
394
|
-
app_version: { type: "string" },
|
|
395
|
-
release_id: {
|
|
396
|
-
type: "string",
|
|
397
|
-
maxLength: 36
|
|
398
|
-
},
|
|
399
|
-
bundle_kind: {
|
|
400
|
-
type: "string",
|
|
401
|
-
maxLength: 16
|
|
402
|
-
},
|
|
403
|
-
bucket_start_ms: { type: "integer" }
|
|
404
|
-
}, {
|
|
405
|
-
key: [
|
|
406
|
-
"channel",
|
|
407
|
-
"platform",
|
|
408
|
-
"app_version",
|
|
409
|
-
"release_id",
|
|
410
|
-
"bundle_kind",
|
|
411
|
-
"bucket_start_ms"
|
|
412
|
-
],
|
|
413
|
-
gauges: ["installations"],
|
|
414
|
-
shards: GAUGE_SHARDS,
|
|
415
|
-
batched: true,
|
|
416
|
-
indexes: { byScope: {
|
|
417
|
-
eq: ["channel", "platform"],
|
|
418
|
-
sort: ["bucket_start_ms"]
|
|
419
|
-
} },
|
|
420
|
-
retention
|
|
421
|
-
});
|
|
422
346
|
/** Latest events by the bundle they came from or went to, bucketed like the distribution. */
|
|
423
347
|
const insightsLatestByBundle = (retention) => defineAggregate({
|
|
424
348
|
platform: {
|
|
@@ -538,8 +462,6 @@ const createInsightsSchema = ({ rawDays, dailyDays } = DEFAULT_INSIGHTS_RETENTIO
|
|
|
538
462
|
insights_overview_lifetime: counters(),
|
|
539
463
|
insights_sketches_lifetime: lifetimeSketches(),
|
|
540
464
|
insights_distribution: insightsDistribution(daily),
|
|
541
|
-
bundle_daily_heads: bundleDailyHeads(daily),
|
|
542
|
-
insights_distribution_history: insightsDistributionHistory(daily),
|
|
543
465
|
insights_latest_by_bundle: insightsLatestByBundle(daily),
|
|
544
466
|
insights_outcomes: insightsOutcomes(hourly),
|
|
545
467
|
insights_failures: insightsFailures(hourly)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/plugin-insights",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.32",
|
|
5
5
|
"description": "Hot Updater's Insights plugin: launch, download, and update failure events, for the server and the React Native app",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./client": {
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"package.json"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@hot-updater/protocol": "1.0.0-rc.
|
|
36
|
+
"@hot-updater/protocol": "1.0.0-rc.29"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@hot-updater/plugin-core": "^1.0.0-rc.
|
|
39
|
+
"@hot-updater/plugin-core": "^1.0.0-rc.29"
|
|
40
40
|
},
|
|
41
41
|
"peerDependenciesMeta": {
|
|
42
42
|
"@hot-updater/plugin-core": {
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^20",
|
|
48
48
|
"vitest": "4.1.4",
|
|
49
|
-
"@hot-updater/plugin-core": "1.0.0-rc.
|
|
50
|
-
"@hot-updater/test-utils": "1.0.0-rc.
|
|
49
|
+
"@hot-updater/plugin-core": "1.0.0-rc.29",
|
|
50
|
+
"@hot-updater/test-utils": "1.0.0-rc.30"
|
|
51
51
|
},
|
|
52
52
|
"nx": {
|
|
53
53
|
"implicitDependencies": [
|