@mark1russell7/service 0.8.0 → 0.8.1
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/README.md +2 -1
- package/build/{builder-BWfcgx__.d.ts → builder-DQj3NNNc.d.ts} +3 -3
- package/build/{core-Cuh3oSfr.d.ts → core-Dt0HEVMq.d.ts} +4 -4
- package/build/{dial-ZJNa6s9i.d.ts → dial-CSQOl-yj.d.ts} +2 -2
- package/build/grpc.d.ts +3 -3
- package/build/host.d.ts +2 -2
- package/build/host.js +7 -1
- package/build/host.js.map +1 -1
- package/build/http-client.d.ts +3 -3
- package/build/http.d.ts +1 -1
- package/build/index.d.ts +5 -5
- package/build/index.js +13 -1
- package/build/index.js.map +1 -1
- package/build/{lifecycle-C8ffyrQ9.d.ts → lifecycle-Br0jAjTk.d.ts} +2 -2
- package/build/{logger-BY1RFLzq.d.ts → logger-BN2BfPgU.d.ts} +18 -2
- package/build/mongodb.d.ts +3 -3
- package/build/otel.d.ts +7 -0
- package/build/otel.js +14 -0
- package/build/otel.js.map +1 -0
- package/build/pg.d.ts +2 -2
- package/build/{ports-D-Anj51B.d.ts → ports-CSr7qWrA.d.ts} +2 -2
- package/build/{queue-rfmKMwju.d.ts → queue-fIkOXKVG.d.ts} +3 -3
- package/build/rabbitmq.d.ts +4 -4
- package/build/redis.d.ts +2 -2
- package/build/testing.d.ts +4 -4
- package/build/websocket.d.ts +3 -3
- package/package.json +12 -2
package/README.md
CHANGED
|
@@ -91,6 +91,7 @@ The format of a description is `mark1russell7.service/1`.
|
|
|
91
91
|
- **The levels.** Each step of the startup, each phase with its cap, its outcome and its duration, and the exit code are `info`. A phase at its cap is `warn`, and an error of the lifecycle is `error`. The polls are `debug`.
|
|
92
92
|
- **The logger port.** A `Logger` has one method, `log(level, message, fields)`, thus an adapter to another logger is a few lines. `consoleLogger({ level })` writes to the console at `info` and above by default.
|
|
93
93
|
- **Lines of JSON.** `consoleLogger({ level, format: "json" })` writes one line of JSON for each entry, with `level`, `message` and each field. An error field gives its name, its message and its stack. The default format is `text`, as before.
|
|
94
|
+
- **Trace ids.** `consoleLogger({ traceIds })`, with `traceIds` from `@mark1russell7/service/otel`, adds the `trace_id` and the `span_id` of the active span of OpenTelemetry to each entry. A field of the entry with the same name stays. When no span is active, for example when no program registered an SDK, the entry does not change. Only the entry `/otel` loads `@opentelemetry/api`.
|
|
94
95
|
- **No logger.** Without a logger, the runtime writes no log, as before. `testLogger()` of `@mark1russell7/service/testing` keeps each entry, thus a test can examine the log.
|
|
95
96
|
|
|
96
97
|
## The machines
|
|
@@ -815,7 +816,7 @@ pnpm add @mark1russell7/service
|
|
|
815
816
|
|
|
816
817
|
For the Redis client, the application also installs `ioredis@6`. For the PostgreSQL client, it installs `pg@8`. For the MongoDB client, it installs `mongodb@7`. For the RabbitMQ client, it installs `amqplib@2`. For the WebSocket client, it installs `ws@8`.
|
|
817
818
|
|
|
818
|
-
For the gRPC client, it installs `@grpc/grpc-js@1`. The HTTP client needs no other package.
|
|
819
|
+
For the gRPC client, it installs `@grpc/grpc-js@1`. The HTTP client needs no other package. For the trace ids of `/otel`, it installs `@opentelemetry/api@1`.
|
|
819
820
|
|
|
820
821
|
### One copy of service
|
|
821
822
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as Clock } from "./clock-DpVgpY4h.js";
|
|
2
2
|
import { l as LimiterSpec } from "./policy-CwYR95Sz.js";
|
|
3
|
-
import {
|
|
4
|
-
import { D as CheckFn, E as StartOptions, F as Outcome, L as Trace, S as Health, d as TransportImpl, n as HealthServer, o as PhaseWork, r as Lifecycle, s as RunOptions, t as DependencyHandle } from "./lifecycle-
|
|
3
|
+
import { $ as ProcessTrigger, E as Phase, F as Timing, N as Poll, O as RepeatSignal, S as ExitCodes, T as MessageTrigger, V as OperationOf, _ as Check, b as Coupling, k as ServiceDescription, q as ExitTrigger, ut as Operation, w as Gate, x as Dependency, y as CooperativeFloor } from "./logger-BN2BfPgU.js";
|
|
4
|
+
import { D as CheckFn, E as StartOptions, F as Outcome, L as Trace, S as Health, d as TransportImpl, n as HealthServer, o as PhaseWork, r as Lifecycle, s as RunOptions, t as DependencyHandle } from "./lifecycle-Br0jAjTk.js";
|
|
5
5
|
import { Extent, Quantity } from "@mark1russell7/quantity";
|
|
6
6
|
//#region src/profiles.d.ts
|
|
7
7
|
/**
|
|
@@ -209,4 +209,4 @@ interface ServiceBuilder {
|
|
|
209
209
|
declare const service: (name: string) => ServiceBuilder;
|
|
210
210
|
//#endregion
|
|
211
211
|
export { WatchdogSpec as a, Profile as c, kubernetes as d, localDev as f, Watchdog as i, daemon as l, ServiceBuilder as n, watchdog as o, service as r, PodTiming as s, ControllerBuilder as t, ephemeral as u };
|
|
212
|
-
//# sourceMappingURL=builder-
|
|
212
|
+
//# sourceMappingURL=builder-DQj3NNNc.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as Backoff } from "./backoff-B-jGWVDm.js";
|
|
2
2
|
import { n as Clock } from "./clock-DpVgpY4h.js";
|
|
3
|
-
import {
|
|
4
|
-
import { D as CheckFn, t as DependencyHandle } from "./lifecycle-
|
|
5
|
-
import { n as ServiceBuilder } from "./builder-
|
|
3
|
+
import { A as Step, N as Poll, _ as Check, g as Recorder, k as ServiceDescription, ut as Operation, w as Gate, x as Dependency } from "./logger-BN2BfPgU.js";
|
|
4
|
+
import { D as CheckFn, t as DependencyHandle } from "./lifecycle-Br0jAjTk.js";
|
|
5
|
+
import { n as ServiceBuilder } from "./builder-DQj3NNNc.js";
|
|
6
6
|
import { Extent, Quantity } from "@mark1russell7/quantity";
|
|
7
7
|
//#region src/client/meets.d.ts
|
|
8
8
|
/** A situation is what the connection did when the failure started: a command in flight, or idle. */
|
|
@@ -231,4 +231,4 @@ declare const retryProblems: (name: string, knobs: RetryKnobs) => string[];
|
|
|
231
231
|
declare const STARTING_POLL: Poll;
|
|
232
232
|
//#endregion
|
|
233
233
|
export { MANIFESTATIONS as C, firstDetector as D, Situation as E, unwatched as O, Detector as S, Meeting as T, Sent as _, ClientKnobs as a, retryProblems as b, ClientSpec as c, Factory as d, ReadyWait as f, SendOptions as g, STARTING_POLL as h, ClientJoin as i, ClientStep as l, RetrySchedule as m, CheckOptions as n, ClientOptions as o, RetryKnobs as p, Client as r, ClientSocket as s, Attempt as t, DialFn as u, readyWait as v, Manifestation as w, retrySchedule as x, retryBackoff as y };
|
|
234
|
-
//# sourceMappingURL=core-
|
|
234
|
+
//# sourceMappingURL=core-Dt0HEVMq.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./core-
|
|
1
|
+
import "./core-Dt0HEVMq.js";
|
|
2
2
|
//#region src/client/dial.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* A judge reads the bytes that the server sent so far. It gives null for a good answer, an error for
|
|
@@ -13,4 +13,4 @@ type Judge = (received: Buffer) => Error | null | "more";
|
|
|
13
13
|
declare const statusLineJudge: (accept: (status: number, line: string) => Error | null) => Judge;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { statusLineJudge as n, Judge as t };
|
|
16
|
-
//# sourceMappingURL=dial-
|
|
16
|
+
//# sourceMappingURL=dial-CSQOl-yj.d.ts.map
|
package/build/grpc.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as MANIFESTATIONS, D as firstDetector, E as Situation, O as unwatched, S as Detector, T as Meeting, _ as Sent, a as ClientKnobs, b as retryProblems, c as ClientSpec, d as Factory, f as ReadyWait, g as SendOptions, h as STARTING_POLL, i as ClientJoin, l as ClientStep, n as CheckOptions, o as ClientOptions, p as RetryKnobs, r as Client, s as ClientSocket, t as Attempt, u as DialFn, v as readyWait, w as Manifestation } from "./core-
|
|
3
|
-
import { t as Judge } from "./dial-
|
|
1
|
+
import { N as Poll, ut as Operation } from "./logger-BN2BfPgU.js";
|
|
2
|
+
import { C as MANIFESTATIONS, D as firstDetector, E as Situation, O as unwatched, S as Detector, T as Meeting, _ as Sent, a as ClientKnobs, b as retryProblems, c as ClientSpec, d as Factory, f as ReadyWait, g as SendOptions, h as STARTING_POLL, i as ClientJoin, l as ClientStep, n as CheckOptions, o as ClientOptions, p as RetryKnobs, r as Client, s as ClientSocket, t as Attempt, u as DialFn, v as readyWait, w as Manifestation } from "./core-Dt0HEVMq.js";
|
|
3
|
+
import { t as Judge } from "./dial-CSQOl-yj.js";
|
|
4
4
|
import { Extent, Quantity } from "@mark1russell7/quantity";
|
|
5
5
|
import { Machine } from "@mark1russell7/algebra";
|
|
6
6
|
//#region src/grpc/connection.d.ts
|
package/build/host.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as Backoff } from "./backoff-B-jGWVDm.js";
|
|
2
2
|
import { n as Clock } from "./clock-DpVgpY4h.js";
|
|
3
|
-
import {
|
|
4
|
-
import { a as FilePort, c as ProcessMark, d as StopSignal, f as joinPath, i as CommandResult, l as ProcessesPort, n as CommandOptions, o as HostPorts, r as CommandPort, s as NetPort, t as ChildHandle, u as SpawnRequest } from "./ports-
|
|
3
|
+
import { Y as MessageShape, c as Logger } from "./logger-BN2BfPgU.js";
|
|
4
|
+
import { a as FilePort, c as ProcessMark, d as StopSignal, f as joinPath, i as CommandResult, l as ProcessesPort, n as CommandOptions, o as HostPorts, r as CommandPort, s as NetPort, t as ChildHandle, u as SpawnRequest } from "./ports-CSr7qWrA.js";
|
|
5
5
|
import { Quantity } from "@mark1russell7/quantity";
|
|
6
6
|
//#region src/host/render.d.ts
|
|
7
7
|
/**
|
package/build/host.js
CHANGED
|
@@ -1590,6 +1590,12 @@ const nodeFiles = {
|
|
|
1590
1590
|
};
|
|
1591
1591
|
/** This difference is the time from the start of the Windows file time (1601) to the start of the epoch (1970), in milliseconds. */
|
|
1592
1592
|
const FILETIME_EPOCH_MS = 11644473600000n;
|
|
1593
|
+
/**
|
|
1594
|
+
* This limit is the longest time of the query of a start time on Windows, in milliseconds. A cold start of PowerShell
|
|
1595
|
+
* on a loaded host can take more than 10 seconds (SYS-47). After the limit the start time is null, and the lock then
|
|
1596
|
+
* counts a live process ID as its owner. Thus a short limit can hold a stale lock, and the limit is wide.
|
|
1597
|
+
*/
|
|
1598
|
+
const WINDOWS_START_LIMIT_MS = 3e4;
|
|
1593
1599
|
/** This function gives the start time of a Windows process from PowerShell, in milliseconds after the epoch, or null. */
|
|
1594
1600
|
const windowsStart = async (pid) => {
|
|
1595
1601
|
const result = await nodeCommands.run("powershell.exe", [
|
|
@@ -1597,7 +1603,7 @@ const windowsStart = async (pid) => {
|
|
|
1597
1603
|
"-NonInteractive",
|
|
1598
1604
|
"-Command",
|
|
1599
1605
|
`(Get-Process -Id ${pid} -ErrorAction Stop).StartTime.ToFileTimeUtc()`
|
|
1600
|
-
], { timeout:
|
|
1606
|
+
], { timeout: WINDOWS_START_LIMIT_MS });
|
|
1601
1607
|
const text = result.out.trim();
|
|
1602
1608
|
if (result.code !== 0 || !/^\d+$/.test(text)) return null;
|
|
1603
1609
|
return Number(BigInt(text) / 10000n - FILETIME_EPOCH_MS);
|