@rebasepro/types 0.34.1 → 0.34.2

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.
@@ -395,6 +395,38 @@ export interface RealtimeCounts {
395
395
  busFramesPublished: Record<string, number>;
396
396
  /** Broadcasts and presence changes not published because no other instance had members. */
397
397
  busFramesSkipped: number;
398
+ /** What this process's sockets did since it started. Absent on a provider that does not count them. */
399
+ socketTotals?: RealtimeSocketTotals;
400
+ }
401
+ /**
402
+ * Running totals of what one process's sockets did, for `/metrics`.
403
+ * @group Backend
404
+ */
405
+ export interface RealtimeSocketTotals {
406
+ /** Sockets opened. */
407
+ opened: number;
408
+ /**
409
+ * Sockets closed, by who ended them: `client`, `client_watchdog`,
410
+ * `network`, `no_pong`, `backlog`, `session`, `ceiling`, `shutdown`,
411
+ * `oversized_frame`, `server`.
412
+ */
413
+ closedBy: Record<string, number>;
414
+ /** Sockets closed, by close code (`other` for an application code Rebase does not use). */
415
+ closeCodes: Record<string, number>;
416
+ /** Frames received. */
417
+ framesIn: number;
418
+ /** Bytes of the frames received. */
419
+ bytesIn: number;
420
+ /** Frames the realtime service pushed: broadcasts, presence and subscription updates. */
421
+ framesOut: number;
422
+ /** Bytes of the frames pushed. */
423
+ bytesOut: number;
424
+ /**
425
+ * Frames refused, by code: `RATE_LIMITED`, `CHANNEL_FORBIDDEN`,
426
+ * `CHANNEL_BUS_PAYLOAD_TOO_LARGE`, `FRAME_TOO_LARGE`, `AUTH_UNAVAILABLE`
427
+ * (the identity could not be re-checked), `UNAUTHORIZED`.
428
+ */
429
+ refused: Record<string, number>;
398
430
  }
399
431
  /**
400
432
  * The table registry a data driver builds for itself and returns on
@@ -168,12 +168,12 @@ export type ChannelBusConfig =
168
168
  /**
169
169
  * Postgres LISTEN/NOTIFY, reusing infrastructure the deployment already has.
170
170
  *
171
- * `pg_notify` caps a payload at 8000 bytes, so a broadcast larger than that
172
- * is delivered cross-instance only on a *retained* channel, where the
171
+ * `pg_notify` caps a payload at 8000 bytes. On a *retained* channel the
173
172
  * notification carries a pointer (`seq`) instead of the message and each
174
- * receiver reads the body back from `rebase.channel_messages`. An oversized
175
- * broadcast on an ephemeral channel is refused rather than silently
176
- * delivered to half the cluster.
173
+ * receiver reads the body back from `rebase.channel_messages`. On an
174
+ * ephemeral channel a broadcast over the cap travels in parts, sent
175
+ * together in one statement and put back together by each receiver, up to
176
+ * 1 MiB; only a larger one is refused to its sender.
177
177
  *
178
178
  * NOTE: `LISTEN` needs a session-mode connection. Behind PgBouncer in
179
179
  * transaction mode this must point at the database directly
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebasepro/types",
3
- "version": "0.34.1",
3
+ "version": "0.34.2",
4
4
  "description": "Rebase type definitions — shared interfaces and controller types",
5
5
  "keywords": [
6
6
  "rebase",