@checkstack/backend 0.4.10 → 0.4.12
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# @checkstack/backend
|
|
2
2
|
|
|
3
|
+
## 0.4.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [3dd1914]
|
|
8
|
+
- @checkstack/backend-api@0.7.0
|
|
9
|
+
- @checkstack/queue-api@0.2.4
|
|
10
|
+
- @checkstack/signal-backend@0.1.10
|
|
11
|
+
|
|
12
|
+
## 0.4.11
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 48c2080: Migrate aggregation from batch to incremental (`mergeResult`)
|
|
17
|
+
|
|
18
|
+
### Breaking Changes (Internal)
|
|
19
|
+
|
|
20
|
+
- Replaced `aggregateResult(runs[])` with `mergeResult(existing, run)` interface across all HealthCheckStrategy and CollectorStrategy implementations
|
|
21
|
+
|
|
22
|
+
### New Features
|
|
23
|
+
|
|
24
|
+
- Added incremental aggregation utilities in `@checkstack/backend-api`:
|
|
25
|
+
- `mergeCounter()` - track occurrences
|
|
26
|
+
- `mergeAverage()` - track sum/count, compute avg
|
|
27
|
+
- `mergeRate()` - track success/total, compute %
|
|
28
|
+
- `mergeMinMax()` - track min/max values
|
|
29
|
+
- Exported Zod schemas for internal state: `averageStateSchema`, `rateStateSchema`, `minMaxStateSchema`, `counterStateSchema`
|
|
30
|
+
|
|
31
|
+
### Improvements
|
|
32
|
+
|
|
33
|
+
- Enables O(1) storage overhead by maintaining incremental aggregation state
|
|
34
|
+
- Prepares for real-time hourly aggregation without batch accumulation
|
|
35
|
+
|
|
36
|
+
- Updated dependencies [f676e11]
|
|
37
|
+
- Updated dependencies [48c2080]
|
|
38
|
+
- @checkstack/common@0.6.2
|
|
39
|
+
- @checkstack/backend-api@0.6.0
|
|
40
|
+
- @checkstack/api-docs-common@0.1.6
|
|
41
|
+
- @checkstack/auth-common@0.5.5
|
|
42
|
+
- @checkstack/signal-backend@0.1.9
|
|
43
|
+
- @checkstack/signal-common@0.1.6
|
|
44
|
+
- @checkstack/queue-api@0.2.3
|
|
45
|
+
|
|
3
46
|
## 0.4.10
|
|
4
47
|
|
|
5
48
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
createBackendPlugin,
|
|
5
5
|
HealthCheckStrategy,
|
|
6
6
|
Versioned,
|
|
7
|
+
VersionedAggregated,
|
|
8
|
+
aggregatedCounter,
|
|
7
9
|
} from "@checkstack/backend-api";
|
|
8
10
|
import {
|
|
9
11
|
createMockQueueManager,
|
|
@@ -50,12 +52,12 @@ describe("HealthCheck Plugin Integration", () => {
|
|
|
50
52
|
version: 1,
|
|
51
53
|
schema: z.record(z.string(), z.unknown()),
|
|
52
54
|
}),
|
|
53
|
-
aggregatedResult: new
|
|
55
|
+
aggregatedResult: new VersionedAggregated({
|
|
54
56
|
version: 1,
|
|
55
|
-
|
|
57
|
+
fields: { count: aggregatedCounter({}) },
|
|
56
58
|
}),
|
|
57
59
|
createClient: mockCreateClient,
|
|
58
|
-
|
|
60
|
+
mergeResult: mock(() => ({})),
|
|
59
61
|
};
|
|
60
62
|
|
|
61
63
|
// 2. Define a mock plugin that registers this strategy
|
|
@@ -3,7 +3,12 @@ import {
|
|
|
3
3
|
CoreHealthCheckRegistry,
|
|
4
4
|
createScopedHealthCheckRegistry,
|
|
5
5
|
} from "./health-check-registry";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
HealthCheckStrategy,
|
|
8
|
+
Versioned,
|
|
9
|
+
VersionedAggregated,
|
|
10
|
+
aggregatedCounter,
|
|
11
|
+
} from "@checkstack/backend-api";
|
|
7
12
|
import { createMockLogger } from "@checkstack/test-utils-backend";
|
|
8
13
|
import { z } from "zod";
|
|
9
14
|
import type { PluginMetadata } from "@checkstack/common";
|
|
@@ -31,14 +36,14 @@ describe("CoreHealthCheckRegistry", () => {
|
|
|
31
36
|
version: 1,
|
|
32
37
|
schema: z.record(z.string(), z.unknown()),
|
|
33
38
|
}),
|
|
34
|
-
aggregatedResult: new
|
|
39
|
+
aggregatedResult: new VersionedAggregated({
|
|
35
40
|
version: 1,
|
|
36
|
-
|
|
41
|
+
fields: { count: aggregatedCounter({}) },
|
|
37
42
|
}),
|
|
38
43
|
createClient: mock(() =>
|
|
39
|
-
Promise.resolve({ client: { exec: async () => ({}) }, close: () => {} })
|
|
44
|
+
Promise.resolve({ client: { exec: async () => ({}) }, close: () => {} }),
|
|
40
45
|
),
|
|
41
|
-
|
|
46
|
+
mergeResult: mock(() => ({})),
|
|
42
47
|
};
|
|
43
48
|
|
|
44
49
|
const mockStrategy2: HealthCheckStrategy = {
|
|
@@ -53,14 +58,14 @@ describe("CoreHealthCheckRegistry", () => {
|
|
|
53
58
|
version: 1,
|
|
54
59
|
schema: z.record(z.string(), z.unknown()),
|
|
55
60
|
}),
|
|
56
|
-
aggregatedResult: new
|
|
61
|
+
aggregatedResult: new VersionedAggregated({
|
|
57
62
|
version: 1,
|
|
58
|
-
|
|
63
|
+
fields: { count: aggregatedCounter({}) },
|
|
59
64
|
}),
|
|
60
65
|
createClient: mock(() =>
|
|
61
|
-
Promise.resolve({ client: { exec: async () => ({}) }, close: () => {} })
|
|
66
|
+
Promise.resolve({ client: { exec: async () => ({}) }, close: () => {} }),
|
|
62
67
|
),
|
|
63
|
-
|
|
68
|
+
mergeResult: mock(() => ({})),
|
|
64
69
|
};
|
|
65
70
|
|
|
66
71
|
beforeEach(() => {
|