cross-tab-worker-databus 0.21.18 → 0.21.20
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/CHANGELOG.md +40 -0
- package/dist/centrifuge.js +1 -1
- package/dist/centrifuge.shared.worker.js.map +2 -2
- package/dist/{chunk-KRSD6KHE.js → chunk-VQZXIMXR.js} +20 -6
- package/dist/chunk-VQZXIMXR.js.map +7 -0
- package/dist/cjs/centrifuge.cjs +19 -5
- package/dist/cjs/centrifuge.cjs.map +2 -2
- package/dist/cjs/index.cjs +19 -5
- package/dist/cjs/index.cjs.map +2 -2
- package/dist/core/cluster.d.ts +6 -1
- package/dist/core/cluster.d.ts.map +1 -1
- package/dist/core/replay-persistence.d.ts.map +1 -1
- package/dist/core/trace.d.ts +2 -1
- package/dist/core/trace.d.ts.map +1 -1
- package/dist/core/version.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/dist/websocket.d.ts.map +1 -1
- package/dist/workers/port-reaper.d.ts.map +1 -1
- package/docs/roadmap.md +17 -1
- package/docs/zh/roadmap.md +17 -1
- package/package.json +1 -1
- package/dist/chunk-KRSD6KHE.js.map +0 -7
|
@@ -1786,7 +1786,8 @@ var DataBusTraceReporter = class {
|
|
|
1786
1786
|
* Record that a message was dispatched on `topic`. Pops the oldest receive
|
|
1787
1787
|
* timestamp (FIFO) and increments the latency histogram. Dispatches without
|
|
1788
1788
|
* a matching receive (e.g. broadcast fan-out from another tab) still count
|
|
1789
|
-
* as dispatched but do not produce a latency sample
|
|
1789
|
+
* as dispatched but do not produce a latency sample, and neither does a
|
|
1790
|
+
* dispatch whose delay cannot be computed at all.
|
|
1790
1791
|
*/
|
|
1791
1792
|
recordDispatched(topic) {
|
|
1792
1793
|
if (!this.metricsActive) return;
|
|
@@ -1796,11 +1797,13 @@ var DataBusTraceReporter = class {
|
|
|
1796
1797
|
const receivedTimestamp = queue?.shift();
|
|
1797
1798
|
if (queue && queue.length === 0) this.receivedAt.delete(topic);
|
|
1798
1799
|
if (receivedTimestamp === void 0) return;
|
|
1800
|
+
const delayMs = this.now() - receivedTimestamp;
|
|
1801
|
+
if (!Number.isFinite(delayMs)) return;
|
|
1799
1802
|
this.latencySamples += 1;
|
|
1800
|
-
const
|
|
1801
|
-
const bucketIndex = Math.min(LATENCY_BUCKET_COUNT - 1, Math.floor(
|
|
1803
|
+
const measuredMs = Math.max(0, delayMs);
|
|
1804
|
+
const bucketIndex = Math.min(LATENCY_BUCKET_COUNT - 1, Math.floor(measuredMs / LATENCY_BUCKET_SIZE_MS));
|
|
1802
1805
|
this.latencyBuckets[bucketIndex] = (this.latencyBuckets[bucketIndex] ?? 0) + 1;
|
|
1803
|
-
this.latencySumMs +=
|
|
1806
|
+
this.latencySumMs += measuredMs;
|
|
1804
1807
|
}
|
|
1805
1808
|
/** Record deduplication outcomes for the next metrics window. */
|
|
1806
1809
|
recordDedupAccepted() {
|
|
@@ -2457,7 +2460,18 @@ var DedupManager = class {
|
|
|
2457
2460
|
};
|
|
2458
2461
|
|
|
2459
2462
|
// src/core/version.ts
|
|
2460
|
-
var SDK_VERSION =
|
|
2463
|
+
var SDK_VERSION = (
|
|
2464
|
+
// The `''` arm has zero counts in every coverage run and cannot be lit from a
|
|
2465
|
+
// test: `vitest.config.ts` defines the global for the whole suite, and so does
|
|
2466
|
+
// each bundle `scripts/build.mjs` emits, so reaching this side needs a consumer
|
|
2467
|
+
// that bundles `src/` without passing the define — which is also the only
|
|
2468
|
+
// consumer this module is read by at source level. It cannot be deleted either,
|
|
2469
|
+
// since the declaration's type is `string | undefined` and the export's is
|
|
2470
|
+
// `string` (dropping the conditional is TS2322, measured). Recorded here so the
|
|
2471
|
+
// leg reads as a shape the harness cannot reach rather than as a case nobody
|
|
2472
|
+
// exercised.
|
|
2473
|
+
true ? "0.21.20" : ""
|
|
2474
|
+
);
|
|
2461
2475
|
|
|
2462
2476
|
// src/core/data-bus.ts
|
|
2463
2477
|
var DEFAULT_REPLAY_MAX_PER_TOPIC = 100;
|
|
@@ -3688,4 +3702,4 @@ export {
|
|
|
3688
3702
|
parseDataBusPublication,
|
|
3689
3703
|
selectWorkerBackend
|
|
3690
3704
|
};
|
|
3691
|
-
//# sourceMappingURL=chunk-
|
|
3705
|
+
//# sourceMappingURL=chunk-VQZXIMXR.js.map
|