Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): attribute ProcessLauncher-spawned children to their process groups on Linux #48269

Opensaphid(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/48269/headopened View on GitHub

Showing 2 changed files with 108 additions and 2 deletions.

x
0 of 2 viewed, 2 left
90 additions and 0 deletionsapps/server/src/resourceTelemetry/ProcessGroupMetrics.test.tsModified
View file
@@ -4,11 +4,13 @@
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Logger from "effect/Logger";
+import * as Metric from "effect/Metric";
import * as References from "effect/References";
import * as Ref from "effect/Ref";
import * as TestClock from "effect/testing/TestClock";
​
import * as ServerConfig from "../config.ts";
+import * as ProcessLauncher from "../process/ProcessLauncher.ts";
import * as ProcessGroupMetrics from "./ProcessGroupMetrics.ts";
import * as ResourceTelemetry from "./ResourceTelemetry.ts";
​
@@ -67,6 +69,45 @@
other: { residentBytes: 220_000, cpuPercent: 220, count: 3 },
});
});
+​
+ it("attributes children of the ProcessLauncher helper to their own groups", () => {
+ const totals = groupProcesses(
+ [
+ process(100, 1, "node", "server"),
+ process(101, 100, "node", "server-child", "node -e proxy"),
+ process(102, 101, "claude", "server-child", "claude --print"),
+ process(103, 102, "git", "server-child", "git status"),
+ process(104, 101, "codex", "server-child", "codex app-server"),
+ process(105, 101, "chrome-headless", "server-child", "chrome-headless"),
+ ],