@checkstack/backend 0.4.10 → 0.4.11

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,39 @@
1
1
  # @checkstack/backend
2
2
 
3
+ ## 0.4.11
4
+
5
+ ### Patch Changes
6
+
7
+ - 48c2080: Migrate aggregation from batch to incremental (`mergeResult`)
8
+
9
+ ### Breaking Changes (Internal)
10
+
11
+ - Replaced `aggregateResult(runs[])` with `mergeResult(existing, run)` interface across all HealthCheckStrategy and CollectorStrategy implementations
12
+
13
+ ### New Features
14
+
15
+ - Added incremental aggregation utilities in `@checkstack/backend-api`:
16
+ - `mergeCounter()` - track occurrences
17
+ - `mergeAverage()` - track sum/count, compute avg
18
+ - `mergeRate()` - track success/total, compute %
19
+ - `mergeMinMax()` - track min/max values
20
+ - Exported Zod schemas for internal state: `averageStateSchema`, `rateStateSchema`, `minMaxStateSchema`, `counterStateSchema`
21
+
22
+ ### Improvements
23
+
24
+ - Enables O(1) storage overhead by maintaining incremental aggregation state
25
+ - Prepares for real-time hourly aggregation without batch accumulation
26
+
27
+ - Updated dependencies [f676e11]
28
+ - Updated dependencies [48c2080]
29
+ - @checkstack/common@0.6.2
30
+ - @checkstack/backend-api@0.6.0
31
+ - @checkstack/api-docs-common@0.1.6
32
+ - @checkstack/auth-common@0.5.5
33
+ - @checkstack/signal-backend@0.1.9
34
+ - @checkstack/signal-common@0.1.6
35
+ - @checkstack/queue-api@0.2.3
36
+
3
37
  ## 0.4.10
4
38
 
5
39
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/backend",
3
- "version": "0.4.10",
3
+ "version": "0.4.11",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "bun --env-file=../../.env --watch src/index.ts",
@@ -55,7 +55,7 @@ describe("HealthCheck Plugin Integration", () => {
55
55
  schema: z.record(z.string(), z.unknown()),
56
56
  }),
57
57
  createClient: mockCreateClient,
58
- aggregateResult: mock(() => ({})),
58
+ mergeResult: mock(() => ({})),
59
59
  };
60
60
 
61
61
  // 2. Define a mock plugin that registers this strategy
@@ -36,9 +36,9 @@ describe("CoreHealthCheckRegistry", () => {
36
36
  schema: z.record(z.string(), z.unknown()),
37
37
  }),
38
38
  createClient: mock(() =>
39
- Promise.resolve({ client: { exec: async () => ({}) }, close: () => {} })
39
+ Promise.resolve({ client: { exec: async () => ({}) }, close: () => {} }),
40
40
  ),
41
- aggregateResult: mock(() => ({})),
41
+ mergeResult: mock(() => ({})),
42
42
  };
43
43
 
44
44
  const mockStrategy2: HealthCheckStrategy = {
@@ -58,9 +58,9 @@ describe("CoreHealthCheckRegistry", () => {
58
58
  schema: z.record(z.string(), z.unknown()),
59
59
  }),
60
60
  createClient: mock(() =>
61
- Promise.resolve({ client: { exec: async () => ({}) }, close: () => {} })
61
+ Promise.resolve({ client: { exec: async () => ({}) }, close: () => {} }),
62
62
  ),
63
- aggregateResult: mock(() => ({})),
63
+ mergeResult: mock(() => ({})),
64
64
  };
65
65
 
66
66
  beforeEach(() => {