@hadoku/game-server 0.1.112 → 0.1.113
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/frames.d.ts +1 -0
- package/dist/frames.js +9 -0
- package/dist/http/client-events.d.ts +1 -1
- package/dist/http/client-events.js +7 -1
- package/package.json +5 -5
package/dist/frames.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const frames: import("@wolffm/service-kernel/relays").FramesTally;
|
package/dist/frames.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cardtable's frame-rate tally (`@hadoku/service-kernel/relays`'s `framesTally`): one for the whole
|
|
3
|
+
* server, fed every `perf` line as it is logged — a match's over its socket (`play/socket.ts`), a
|
|
4
|
+
* page's over `POST /api/client-events` (`http/client-events.ts`) — and posted as one `frames` event
|
|
5
|
+
* every 5 minutes, which the daily report reads (`packages/devkit/src/telemetry/watch.ts`).
|
|
6
|
+
*/
|
|
7
|
+
import { framesTally } from '@wolffm/service-kernel/relays';
|
|
8
|
+
import { report } from './telemetry.js';
|
|
9
|
+
export const frames = framesTally({ report });
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* socket and it lands in the play log (`play/socket.ts`, `forge:client`); a page outside a match
|
|
6
6
|
* has no such socket, so it sends the same flat facts here, and they land in the same stdout log
|
|
7
7
|
* as `client` events, under `svc: 'cardtable-client'`, keyed by page and user. Nothing is stored
|
|
8
|
-
* and nothing is answered but 204.
|
|
8
|
+
* and nothing is answered but 204; `perf` lines are also rolled up into the 5-minute `frames` event.
|
|
9
9
|
*
|
|
10
10
|
* Every export and signature below is unchanged from before this moved into the kernel:
|
|
11
11
|
* `index.ts` and `play/socket.ts` import this path exactly as they did. The cardtable-specific
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { CLIENT_EVENT_MAX_PER_SECOND, PAGE_EVENT_PATH, PageEventSchema } from '@wolffm/platform-wire/telemetry';
|
|
2
2
|
import { attachClientEvents as kernelAttachClientEvents } from '@wolffm/service-kernel/relays';
|
|
3
3
|
import { userIdOf } from '../edge-auth.js';
|
|
4
|
+
import { frames } from '../frames.js';
|
|
4
5
|
import { jsonLogger } from '@wolffm/service-kernel/log';
|
|
5
6
|
export { malformedFacts } from '@wolffm/service-kernel/relays';
|
|
6
7
|
export function attachClientEvents(api, deps = {}) {
|
|
8
|
+
const log = deps.log ?? jsonLogger('cardtable-client');
|
|
7
9
|
kernelAttachClientEvents(api, {
|
|
8
10
|
schema: PageEventSchema,
|
|
9
11
|
path: PAGE_EVENT_PATH,
|
|
10
12
|
maxPerSecond: CLIENT_EVENT_MAX_PER_SECOND,
|
|
11
13
|
userIdOf,
|
|
12
|
-
|
|
14
|
+
// Each line also feeds the frame-rate tally (`../frames.ts`), which reads only `perf` ones.
|
|
15
|
+
log: (entry) => {
|
|
16
|
+
log(entry);
|
|
17
|
+
frames.note(entry);
|
|
18
|
+
},
|
|
13
19
|
now: deps.now,
|
|
14
20
|
});
|
|
15
21
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hadoku/game-server",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "0.1.113",
|
|
4
|
+
"gitHead": "c052ba27eccdd3f15c913c5604033d46b208a96e",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "The server parts any hosted game shares, above the kernel: the app config and edge auth, the room core (identity, seats, sessions, membership, the room list, the generic room routes), match hosting (the host contract, local and remote JVMs, placement, the start queue, recordings, the in-process and relay runtimes), streams, erase, telemetry and usage. Knows no game; Magic plugs in from apps/server. MIT; imports only node built-ins, express, socket.io, @wolffm/* and the platform packages.",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"play/remote/"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@wolffm/host-wire": "npm:@hadoku/host-wire@0.1.
|
|
21
|
-
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.
|
|
22
|
-
"@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.
|
|
20
|
+
"@wolffm/host-wire": "npm:@hadoku/host-wire@0.1.113",
|
|
21
|
+
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.113",
|
|
22
|
+
"@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.146",
|
|
23
23
|
"@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.1.32",
|
|
24
24
|
"@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.131",
|
|
25
25
|
"@wolffm/rooms-server": "npm:@hadoku/rooms-server@^0.45.131",
|