Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix: freeze notice no longer blames the CPU for disk load #30799

Closedwanqingxiexie(GitHub profile, opens in a new tab)wants to merge 10 commits intomain fromrefs/pull/30799/headopened View on GitHub

Showing 7 changed files with 50 additions and 3 deletions (loading 4).

x
0 of 7 viewed, 7 left
1 addition and 0 deletionsapps/server/src/observability/EventLoopMonitor.test.tsModified
View file
@@ -20,6 +20,7 @@
heapUsedBytes: 512 * 1024 * 1024,
elapsedMs: 30_000,
loadAverage: 219.43,
+ cpuBusy: 0.98,
cpuCount: 18,
};
​
27 additions and 3 deletionsapps/server/src/observability/EventLoopMonitor.tsModified
View file
@@ -1,8 +1,10 @@
-// @effect-diagnostics nodeBuiltinImport:off - only node:perf_hooks exposes the event loop delay histogram, and node:os the load average.
+// @effect-diagnostics nodeBuiltinImport:off - only node:perf_hooks exposes the event loop delay histogram, node:os the load average, and the sampler reads /proc/stat synchronously.
+import * as NodeFS from "node:fs";
import * as NodeOS from "node:os";
import * as NodePerfHooks from "node:perf_hooks";
​
import type { ServerEventLoopStall } from "@t3tools/contracts";
+import * as HostProcess from "@t3tools/shared/HostProcess";
import { RotatingFileSink, RotatingFileSinkError } from "@t3tools/shared/logging";
import * as Context from "effect/Context";
import * as DateTime from "effect/DateTime";
@@ -16,6 +18,7 @@
import * as Semaphore from "effect/Semaphore";
​
import * as ServerConfig from "../config.ts";
+import { cpuBusyBetween, linuxCpu } from "../resourceTelemetry/HostResources.ts";
import * as Metrics from "./Metrics.ts";