@rizom/ops 0.2.0-alpha.652 → 0.2.0-alpha.654
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/brains-ops.js +127 -127
- package/dist/deploy.js +1 -1
- package/dist/index.js +118 -118
- package/dist/stress-health-monitor.d.ts +15 -5
- package/package.json +1 -1
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { FetchLike } from "@brains/utils/fetch-like";
|
|
2
|
+
import { z } from "@brains/utils/zod";
|
|
2
3
|
import { type StressHealthSample, type StressRuntimeSample } from "./directory-sync-stress";
|
|
4
|
+
/** Entity counts by type, as the runtime's database reports them. */
|
|
5
|
+
export declare const stressEntityCountsSchema: z.ZodArray<z.ZodObject<{
|
|
6
|
+
entityType: z.ZodString;
|
|
7
|
+
count: z.ZodNumber;
|
|
8
|
+
}>>;
|
|
9
|
+
export type StressEntityCounts = z.output<typeof stressEntityCountsSchema>;
|
|
3
10
|
export interface HealthPayload {
|
|
4
11
|
version: string;
|
|
5
12
|
entities: number;
|
|
6
|
-
entityCounts:
|
|
7
|
-
entityType: string;
|
|
8
|
-
count: number;
|
|
9
|
-
}[];
|
|
13
|
+
entityCounts: StressEntityCounts;
|
|
10
14
|
}
|
|
11
15
|
export declare function noteCount(payload: HealthPayload): number;
|
|
12
16
|
export interface StressHealthMonitorOptions {
|
|
@@ -16,10 +20,16 @@ export interface StressHealthMonitorOptions {
|
|
|
16
20
|
sleep: (milliseconds: number) => Promise<void>;
|
|
17
21
|
/** Take one runtime sample (e.g. docker stats over SSH), if available. */
|
|
18
22
|
sampleRuntime: () => Promise<StressRuntimeSample | undefined>;
|
|
23
|
+
/**
|
|
24
|
+
* Entity counts by type from an authenticated source (the runtime's
|
|
25
|
+
* database over SSH), or undefined when this poll has no reading.
|
|
26
|
+
*/
|
|
27
|
+
readEntityCounts: () => Promise<StressEntityCounts | undefined>;
|
|
19
28
|
}
|
|
20
29
|
/**
|
|
21
30
|
* Samples deployment health and runtime resource usage during a stress run,
|
|
22
|
-
* and answers entity-baseline waits
|
|
31
|
+
* and answers entity-baseline waits from the operational health endpoint and
|
|
32
|
+
* the runtime's own entity counts.
|
|
23
33
|
*/
|
|
24
34
|
export declare class StressHealthMonitor {
|
|
25
35
|
#private;
|