@mark1russell7/capacity 0.0.0-bootstrap.0 → 0.1.0

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.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1107 -1
  3. package/build/index.d.ts +858 -0
  4. package/build/index.d.ts.map +1 -0
  5. package/build/index.js +1713 -0
  6. package/build/index.js.map +1 -0
  7. package/build/instance-0n6WhJzF.d.ts +782 -0
  8. package/build/instance-0n6WhJzF.d.ts.map +1 -0
  9. package/build/instance-check-CAuD9L4Z.js +1711 -0
  10. package/build/instance-check-CAuD9L4Z.js.map +1 -0
  11. package/build/schema.d.ts +69 -0
  12. package/build/schema.d.ts.map +1 -0
  13. package/build/schema.js +315 -0
  14. package/build/schema.js.map +1 -0
  15. package/limits/alerts-routes.line.json +78 -0
  16. package/limits/alerts-scale.limits.json +10 -0
  17. package/limits/alerts-start-gate.limits.json +1149 -0
  18. package/limits/alerts-start-routes-limit-home.bracket.json +543 -0
  19. package/limits/alerts-start-routes-limit-mid.bracket.json +464 -0
  20. package/limits/alerts-start-routes-limit.bracket.json +579 -0
  21. package/limits/alerts-tail-gate.limits.json +610 -0
  22. package/package.json +79 -4
  23. package/src/app-check.ts +477 -0
  24. package/src/app-metrics.ts +105 -0
  25. package/src/app.ts +239 -0
  26. package/src/check.ts +228 -0
  27. package/src/composition.ts +680 -0
  28. package/src/demand.ts +312 -0
  29. package/src/fit.ts +153 -0
  30. package/src/forms.ts +358 -0
  31. package/src/gate.ts +237 -0
  32. package/src/index.ts +142 -0
  33. package/src/instance-check.ts +122 -0
  34. package/src/instance.ts +84 -0
  35. package/src/knee.ts +606 -0
  36. package/src/law.ts +215 -0
  37. package/src/limit.ts +112 -0
  38. package/src/names.ts +19 -0
  39. package/src/observe.ts +74 -0
  40. package/src/program.ts +74 -0
  41. package/src/scale.ts +617 -0
  42. package/src/schema.ts +260 -0
  43. package/src/value.ts +206 -0
  44. package/src/workload-check.ts +130 -0
  45. package/src/workload.ts +88 -0
@@ -0,0 +1,610 @@
1
+ {
2
+ "format": "capacity-start-limits/1",
3
+ "plan": "alerts-tail-gate",
4
+ "case": "alerts-tail-gate/main",
5
+ "subject": "alerts-runtime",
6
+ "app": "https://github.com/metrograph-labs/alerts.git",
7
+ "arm": "main",
8
+ "commit": "ddcf5108e76ea7a7a772caf7afd0a59080a63c7a",
9
+ "seeder": "96862f9aa64a210a9e1844c7ad9fcfe00bbd49d9",
10
+ "target": {
11
+ "image": "node:24.21.0-bookworm-slim",
12
+ "node": "v24.21.0",
13
+ "memory": {
14
+ "value": 1011425280,
15
+ "unit": "B"
16
+ },
17
+ "swap": {
18
+ "value": 2147483648,
19
+ "unit": "B"
20
+ },
21
+ "cpus": 2,
22
+ "heapLimit": {
23
+ "value": 556269568,
24
+ "unit": "B"
25
+ }
26
+ },
27
+ "runs": [
28
+ {
29
+ "id": "46242927847/1/1",
30
+ "url": "https://github.com/metrograph-labs/capacity/actions/runs/46242927847",
31
+ "job": "1",
32
+ "attempt": 1,
33
+ "cpu": "Intel(R) Xeon(R) 6975P-C"
34
+ },
35
+ {
36
+ "id": "46242927847/2/1",
37
+ "url": "https://github.com/metrograph-labs/capacity/actions/runs/46242927847",
38
+ "job": "2",
39
+ "attempt": 1,
40
+ "cpu": "AMD EPYC 9V45 96-Core Processor"
41
+ },
42
+ {
43
+ "id": "46242927847/3/1",
44
+ "url": "https://github.com/metrograph-labs/capacity/actions/runs/46242927847",
45
+ "job": "3",
46
+ "attempt": 1,
47
+ "cpu": "AMD EPYC 7763 64-Core Processor"
48
+ },
49
+ {
50
+ "id": "46242927847/4/1",
51
+ "url": "https://github.com/metrograph-labs/capacity/actions/runs/46242927847",
52
+ "job": "4",
53
+ "attempt": 1,
54
+ "cpu": "Intel(R) Xeon(R) 6975P-C"
55
+ },
56
+ {
57
+ "id": "46242927847/5/1",
58
+ "url": "https://github.com/metrograph-labs/capacity/actions/runs/46242927847",
59
+ "job": "5",
60
+ "attempt": 1,
61
+ "cpu": "AMD EPYC 9V74 80-Core Processor"
62
+ },
63
+ {
64
+ "id": "46285448775/1/1",
65
+ "url": "https://github.com/metrograph-labs/capacity/actions/runs/46285448775",
66
+ "job": "1",
67
+ "attempt": 1,
68
+ "cpu": "Intel(R) Xeon(R) 6975P-C"
69
+ },
70
+ {
71
+ "id": "46285448775/2/1",
72
+ "url": "https://github.com/metrograph-labs/capacity/actions/runs/46285448775",
73
+ "job": "2",
74
+ "attempt": 1,
75
+ "cpu": "Intel(R) Xeon(R) 6975P-C"
76
+ },
77
+ {
78
+ "id": "46285448775/3/1",
79
+ "url": "https://github.com/metrograph-labs/capacity/actions/runs/46285448775",
80
+ "job": "3",
81
+ "attempt": 1,
82
+ "cpu": "AMD EPYC 7763 64-Core Processor"
83
+ },
84
+ {
85
+ "id": "46285448775/4/1",
86
+ "url": "https://github.com/metrograph-labs/capacity/actions/runs/46285448775",
87
+ "job": "4",
88
+ "attempt": 1,
89
+ "cpu": "Intel(R) Xeon(R) 6975P-C"
90
+ },
91
+ {
92
+ "id": "46285448775/5/1",
93
+ "url": "https://github.com/metrograph-labs/capacity/actions/runs/46285448775",
94
+ "job": "5",
95
+ "attempt": 1,
96
+ "cpu": "AMD EPYC 7763 64-Core Processor"
97
+ },
98
+ {
99
+ "id": "46291309770/1/1",
100
+ "url": "https://github.com/metrograph-labs/capacity/actions/runs/46291309770",
101
+ "job": "1",
102
+ "attempt": 1,
103
+ "cpu": "Intel(R) Xeon(R) 6975P-C"
104
+ },
105
+ {
106
+ "id": "46291309770/2/1",
107
+ "url": "https://github.com/metrograph-labs/capacity/actions/runs/46291309770",
108
+ "job": "2",
109
+ "attempt": 1,
110
+ "cpu": "Intel(R) Xeon(R) 6975P-C"
111
+ },
112
+ {
113
+ "id": "46291309770/3/1",
114
+ "url": "https://github.com/metrograph-labs/capacity/actions/runs/46291309770",
115
+ "job": "3",
116
+ "attempt": 1,
117
+ "cpu": "Intel(R) Xeon(R) 6973P-C"
118
+ },
119
+ {
120
+ "id": "46291309770/4/1",
121
+ "url": "https://github.com/metrograph-labs/capacity/actions/runs/46291309770",
122
+ "job": "4",
123
+ "attempt": 1,
124
+ "cpu": "AMD EPYC 9V74 80-Core Processor"
125
+ },
126
+ {
127
+ "id": "46291309770/5/1",
128
+ "url": "https://github.com/metrograph-labs/capacity/actions/runs/46291309770",
129
+ "job": "5",
130
+ "attempt": 1,
131
+ "cpu": "AMD EPYC 7763 64-Core Processor"
132
+ }
133
+ ],
134
+ "measures": [
135
+ {
136
+ "id": "start.live",
137
+ "reading": "live",
138
+ "unit": "B",
139
+ "title": "The used heap after a full GC at ready"
140
+ },
141
+ {
142
+ "id": "start.peak",
143
+ "reading": "peak",
144
+ "unit": "B",
145
+ "title": "The peak of the resident set at ready (VmHWM)"
146
+ },
147
+ {
148
+ "id": "start.readiness",
149
+ "reading": "readiness",
150
+ "unit": "ms",
151
+ "title": "The time from the start of the process to the ready signal"
152
+ },
153
+ {
154
+ "id": "start.longest",
155
+ "reading": "startLongest",
156
+ "unit": "ms",
157
+ "title": "The longest block of the event loop from the start of the process to ready"
158
+ },
159
+ {
160
+ "id": "watch.longest",
161
+ "reading": "watchLongest",
162
+ "unit": "ms",
163
+ "title": "The longest block of the event loop in the watch after ready"
164
+ }
165
+ ],
166
+ "points": [
167
+ {
168
+ "id": "tail-53790",
169
+ "at": {
170
+ "log": {
171
+ "value": 197156864,
172
+ "unit": "B"
173
+ },
174
+ "feeds": {
175
+ "value": 10,
176
+ "unit": "{feed}"
177
+ },
178
+ "persons": {
179
+ "value": 10,
180
+ "unit": "{person}"
181
+ },
182
+ "incidents": {
183
+ "value": 10,
184
+ "unit": "{incident}"
185
+ },
186
+ "gdelt": {
187
+ "value": 0,
188
+ "unit": "{place}"
189
+ },
190
+ "score": {
191
+ "value": 0,
192
+ "unit": "{person}"
193
+ },
194
+ "chain": {
195
+ "value": 0,
196
+ "unit": "{stack}"
197
+ },
198
+ "tail": {
199
+ "value": 53790,
200
+ "unit": "{event}"
201
+ }
202
+ },
203
+ "limits": {
204
+ "format": "capacity-limits/1",
205
+ "id": "alerts-tail-gate/main/tail-53790",
206
+ "title": "The start limits of alerts-runtime at the point tail-53790 of alerts-tail-gate/main",
207
+ "limits": [
208
+ {
209
+ "id": "start.live",
210
+ "measure": "start.live",
211
+ "ceiling": {
212
+ "kind": "amount",
213
+ "amount": {
214
+ "value": 86346536,
215
+ "unit": "B"
216
+ }
217
+ },
218
+ "headroom": 0
219
+ },
220
+ {
221
+ "id": "start.peak",
222
+ "measure": "start.peak",
223
+ "ceiling": {
224
+ "kind": "amount",
225
+ "amount": {
226
+ "value": 456204288,
227
+ "unit": "B"
228
+ }
229
+ },
230
+ "headroom": 0
231
+ },
232
+ {
233
+ "id": "start.readiness",
234
+ "measure": "start.readiness",
235
+ "ceiling": {
236
+ "kind": "amount",
237
+ "amount": {
238
+ "value": 14986,
239
+ "unit": "ms"
240
+ }
241
+ },
242
+ "headroom": 0
243
+ },
244
+ {
245
+ "id": "start.longest",
246
+ "measure": "start.longest",
247
+ "ceiling": {
248
+ "kind": "amount",
249
+ "amount": {
250
+ "value": 8031,
251
+ "unit": "ms"
252
+ }
253
+ },
254
+ "headroom": 0
255
+ },
256
+ {
257
+ "id": "watch.longest",
258
+ "measure": "watch.longest",
259
+ "ceiling": {
260
+ "kind": "amount",
261
+ "amount": {
262
+ "value": 241,
263
+ "unit": "ms"
264
+ }
265
+ },
266
+ "headroom": 0
267
+ }
268
+ ]
269
+ },
270
+ "derivations": {
271
+ "start.live": {
272
+ "limit": 86346536,
273
+ "worst": 84974544,
274
+ "spread": 1371992,
275
+ "values": [
276
+ 84225568,
277
+ 84396280,
278
+ 84531856,
279
+ 84360840,
280
+ 84846760,
281
+ 83802112,
282
+ 84153312,
283
+ 84957832,
284
+ 83602552,
285
+ 84974544,
286
+ 83792480,
287
+ 84150648,
288
+ 84766616,
289
+ 84638704,
290
+ 83875928
291
+ ],
292
+ "unit": "B"
293
+ },
294
+ "start.peak": {
295
+ "limit": 456204288,
296
+ "worst": 399663104,
297
+ "spread": 56541184,
298
+ "values": [
299
+ 379703296,
300
+ 399663104,
301
+ 368455680,
302
+ 352124928,
303
+ 394711040,
304
+ 348700672,
305
+ 358924288,
306
+ 375914496,
307
+ 343121920,
308
+ 383913984,
309
+ 358875136,
310
+ 359190528,
311
+ 396218368,
312
+ 398782464,
313
+ 360538112
314
+ ],
315
+ "unit": "B"
316
+ },
317
+ "start.readiness": {
318
+ "limit": 14986,
319
+ "worst": 11786.652608,
320
+ "spread": 3198.4522780000007,
321
+ "values": [
322
+ 9566.641467,
323
+ 10259.388295,
324
+ 10621.40343,
325
+ 9707.448143000001,
326
+ 10232.01607,
327
+ 9261.200163,
328
+ 8588.20033,
329
+ 10461.061596,
330
+ 9777.046121,
331
+ 11786.652608,
332
+ 9726.82119,
333
+ 9398.7359,
334
+ 8973.430545,
335
+ 10294.351846,
336
+ 10438.454814
337
+ ],
338
+ "unit": "ms"
339
+ },
340
+ "start.longest": {
341
+ "limit": 8031,
342
+ "worst": 5220.338794,
343
+ "spread": 2810.1818010000006,
344
+ "values": [
345
+ 3636.9543350000004,
346
+ 4119.927538,
347
+ 5220.338794,
348
+ 3883.253449,
349
+ 4086.898843,
350
+ 3810.6438,
351
+ 2410.1569929999996,
352
+ 4493.040214000001,
353
+ 3771.8160620000003,
354
+ 5104.372549,
355
+ 3687.281807,
356
+ 3868.485196,
357
+ 3720.638986,
358
+ 4220.79019,
359
+ 3896.154097
360
+ ],
361
+ "unit": "ms"
362
+ },
363
+ "watch.longest": {
364
+ "limit": 241,
365
+ "worst": 163.57466199999908,
366
+ "spread": 76.59694399999717,
367
+ "values": [
368
+ 86.97771800000191,
369
+ 114.83711799999946,
370
+ 159.18563200000062,
371
+ 96.59934499999508,
372
+ 152.4636160000009,
373
+ 99.77461500000209,
374
+ 93.68957199999568,
375
+ 163.57466199999908,
376
+ 99.23448500000086,
377
+ 139.113695,
378
+ 96.63568300000043,
379
+ 101.91885799999727,
380
+ 115.34939999999915,
381
+ 129.4542719999954,
382
+ 154.42825199999788
383
+ ],
384
+ "unit": "ms"
385
+ }
386
+ }
387
+ },
388
+ {
389
+ "id": "tail-53790-again",
390
+ "at": {
391
+ "log": {
392
+ "value": 197156864,
393
+ "unit": "B"
394
+ },
395
+ "feeds": {
396
+ "value": 10,
397
+ "unit": "{feed}"
398
+ },
399
+ "persons": {
400
+ "value": 10,
401
+ "unit": "{person}"
402
+ },
403
+ "incidents": {
404
+ "value": 10,
405
+ "unit": "{incident}"
406
+ },
407
+ "gdelt": {
408
+ "value": 0,
409
+ "unit": "{place}"
410
+ },
411
+ "score": {
412
+ "value": 0,
413
+ "unit": "{person}"
414
+ },
415
+ "chain": {
416
+ "value": 0,
417
+ "unit": "{stack}"
418
+ },
419
+ "tail": {
420
+ "value": 53790,
421
+ "unit": "{event}"
422
+ }
423
+ },
424
+ "limits": {
425
+ "format": "capacity-limits/1",
426
+ "id": "alerts-tail-gate/main/tail-53790-again",
427
+ "title": "The start limits of alerts-runtime at the point tail-53790-again of alerts-tail-gate/main",
428
+ "limits": [
429
+ {
430
+ "id": "start.live",
431
+ "measure": "start.live",
432
+ "ceiling": {
433
+ "kind": "amount",
434
+ "amount": {
435
+ "value": 85206792,
436
+ "unit": "B"
437
+ }
438
+ },
439
+ "headroom": 0
440
+ },
441
+ {
442
+ "id": "start.peak",
443
+ "measure": "start.peak",
444
+ "ceiling": {
445
+ "kind": "amount",
446
+ "amount": {
447
+ "value": 307240960,
448
+ "unit": "B"
449
+ }
450
+ },
451
+ "headroom": 0
452
+ },
453
+ {
454
+ "id": "start.readiness",
455
+ "measure": "start.readiness",
456
+ "ceiling": {
457
+ "kind": "amount",
458
+ "amount": {
459
+ "value": 3691,
460
+ "unit": "ms"
461
+ }
462
+ },
463
+ "headroom": 0
464
+ },
465
+ {
466
+ "id": "start.longest",
467
+ "measure": "start.longest",
468
+ "ceiling": {
469
+ "kind": "amount",
470
+ "amount": {
471
+ "value": 2118,
472
+ "unit": "ms"
473
+ }
474
+ },
475
+ "headroom": 0
476
+ },
477
+ {
478
+ "id": "watch.longest",
479
+ "measure": "watch.longest",
480
+ "ceiling": {
481
+ "kind": "amount",
482
+ "amount": {
483
+ "value": 288,
484
+ "unit": "ms"
485
+ }
486
+ },
487
+ "headroom": 0
488
+ }
489
+ ]
490
+ },
491
+ "derivations": {
492
+ "start.live": {
493
+ "limit": 85206792,
494
+ "worst": 85131272,
495
+ "spread": 75520,
496
+ "values": [
497
+ 85091624,
498
+ 85119080,
499
+ 85130120,
500
+ 85123496,
501
+ 85111040,
502
+ 85076904,
503
+ 85115424,
504
+ 85131272,
505
+ 85083368,
506
+ 85126944,
507
+ 85074280,
508
+ 85099024,
509
+ 85058672,
510
+ 85055752,
511
+ 85103280
512
+ ],
513
+ "unit": "B"
514
+ },
515
+ "start.peak": {
516
+ "limit": 307240960,
517
+ "worst": 285659136,
518
+ "spread": 21581824,
519
+ "values": [
520
+ 264892416,
521
+ 277393408,
522
+ 268922880,
523
+ 267825152,
524
+ 285659136,
525
+ 265027584,
526
+ 264077312,
527
+ 274927616,
528
+ 266096640,
529
+ 267104256,
530
+ 272338944,
531
+ 269144064,
532
+ 280977408,
533
+ 275693568,
534
+ 268423168
535
+ ],
536
+ "unit": "B"
537
+ },
538
+ "start.readiness": {
539
+ "limit": 3691,
540
+ "worst": 2605.315259,
541
+ "spread": 1085.317841,
542
+ "values": [
543
+ 1559.718817,
544
+ 1768.765095,
545
+ 2571.863383,
546
+ 1601.203478,
547
+ 2061.994043,
548
+ 1553.1154990000002,
549
+ 1612.479735,
550
+ 2603.04019,
551
+ 1580.36883,
552
+ 2507.428737,
553
+ 1519.997418,
554
+ 1579.830818,
555
+ 2605.315259,
556
+ 1966.756614,
557
+ 2596.740951
558
+ ],
559
+ "unit": "ms"
560
+ },
561
+ "start.longest": {
562
+ "limit": 2118,
563
+ "worst": 1502.4748960000002,
564
+ "spread": 615.1895850000002,
565
+ "values": [
566
+ 887.285311,
567
+ 981.486009,
568
+ 1457.83163,
569
+ 902.9902400000001,
570
+ 1131.169984,
571
+ 913.155287,
572
+ 934.970269,
573
+ 1473.286221,
574
+ 906.174539,
575
+ 1439.16468,
576
+ 888.8770650000001,
577
+ 917.3192899999999,
578
+ 1502.4748960000002,
579
+ 1098.152773,
580
+ 1475.003166
581
+ ],
582
+ "unit": "ms"
583
+ },
584
+ "watch.longest": {
585
+ "limit": 288,
586
+ "worst": 180.53894799999398,
587
+ "spread": 107.00392499999452,
588
+ "values": [
589
+ 90.39275300000008,
590
+ 104.09213799999998,
591
+ 179.86984700000176,
592
+ 73.53502299999946,
593
+ 132.33875100000296,
594
+ 82.9719910000058,
595
+ 93.70092300000397,
596
+ 155.58119299999998,
597
+ 91.34695500000089,
598
+ 159.36945399999968,
599
+ 83.44043799999781,
600
+ 81.94258599999921,
601
+ 109.0011169999998,
602
+ 133.94841799999995,
603
+ 180.53894799999398
604
+ ],
605
+ "unit": "ms"
606
+ }
607
+ }
608
+ }
609
+ ]
610
+ }
package/package.json CHANGED
@@ -1,13 +1,88 @@
1
1
  {
2
+ "$schema": "https://json.schemastore.org/package",
2
3
  "name": "@mark1russell7/capacity",
3
- "version": "0.0.0-bootstrap.0",
4
- "description": "A placeholder that lets npm trust the release workflow of metrograph-labs/capacity. Use a later version.",
4
+ "version": "0.1.0",
5
+ "description": "Performance and capacity models: the cost of one request as laws over each load variable, with intervals.",
6
+ "keywords": [
7
+ "performance",
8
+ "capacity",
9
+ "scaling",
10
+ "model",
11
+ "node",
12
+ "typescript"
13
+ ],
14
+ "homepage": "https://github.com/metrograph-labs/capacity#readme",
15
+ "bugs": {
16
+ "url": "https://github.com/metrograph-labs/capacity/issues"
17
+ },
5
18
  "repository": {
6
19
  "type": "git",
7
- "url": "git+https://github.com/metrograph-labs/capacity.git"
20
+ "url": "git+https://github.com/metrograph-labs/capacity.git",
21
+ "directory": "packages/capacity"
8
22
  },
9
23
  "license": "MIT",
24
+ "author": "Mark Russell (https://github.com/mark1russell7)",
25
+ "type": "module",
26
+ "sideEffects": false,
27
+ "main": "./build/index.js",
28
+ "types": "./build/index.d.ts",
29
+ "exports": {
30
+ ".": {
31
+ "types": "./build/index.d.ts",
32
+ "default": "./build/index.js"
33
+ },
34
+ "./schema": {
35
+ "types": "./build/schema.d.ts",
36
+ "default": "./build/schema.js"
37
+ },
38
+ "./limits/*.json": "./limits/*.json",
39
+ "./package.json": "./package.json"
40
+ },
41
+ "files": [
42
+ "build",
43
+ "src",
44
+ "limits",
45
+ "!src/**/*.test.ts",
46
+ "!src/**/*.fixture.ts"
47
+ ],
48
+ "engines": {
49
+ "node": ">=22.12"
50
+ },
10
51
  "publishConfig": {
11
52
  "access": "public"
53
+ },
54
+ "dependencies": {
55
+ "@mark1russell7/optional": "^1.2.0",
56
+ "@mark1russell7/quantity": "^0.4.6",
57
+ "@mark1russell7/rigor-bench": "^0.3.3",
58
+ "@mark1russell7/rigor-statistics": "^0.2.18",
59
+ "@mark1russell7/vex": "^0.20.2",
60
+ "@mark1russell7/vex-compiler": "^0.20.2",
61
+ "@mark1russell7/vex-domains": "^0.20.2"
62
+ },
63
+ "peerDependencies": {
64
+ "zod": "^4.1.0"
65
+ },
66
+ "peerDependenciesMeta": {
67
+ "zod": {
68
+ "optional": true
69
+ }
70
+ },
71
+ "devDependencies": {
72
+ "@mark1russell7/cue": "^2.0.0",
73
+ "@mark1russell7/rigor-testkit": "^0.1.20",
74
+ "@types/node": "^26.6.5",
75
+ "@vitest/coverage-v8": "^5.0.3",
76
+ "fast-check": "^4.10.2",
77
+ "tsdown": "^0.23.7",
78
+ "typescript": "^7.0.2",
79
+ "vitest": "^5.0.3",
80
+ "zod": "^4.1.0"
81
+ },
82
+ "scripts": {
83
+ "build": "tsdown",
84
+ "test": "vitest run",
85
+ "test:watch": "vitest",
86
+ "typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.test.json"
12
87
  }
13
- }
88
+ }