{"_id":"@absolutejs/metering","_rev":"11-0fa2234a953c3d769ce22c471c1af342","name":"@absolutejs/metering","dist-tags":{"latest":"0.7.0"},"versions":{"0.0.1":{"name":"@absolutejs/metering","version":"0.0.1","keywords":["absolutejs","bun","paas","multi-tenant","metering","billing","cost-attribution","circuit-breaker"],"author":"Alex Kahn","license":"BSL-1.1","_id":"@absolutejs/metering@0.0.1","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"dist":{"shasum":"609632d57f4181fce7c1d1f8e957104f5a9d2f51","tarball":"https://registry.npmjs.org/@absolutejs/metering/-/metering-0.0.1.tgz","fileCount":6,"integrity":"sha512-PIGF6ILN78WQNLoiY3rNL6knkCUB+ApQrL1Adudd+85BG7xMnErvQ39/4CqjpmnrjwuFTVIs6HAkXYH9/G2ACw==","signatures":[{"sig":"MEYCIQDAwLDCskhFIEjAfcNAqoUttygMeBcfUmmuap5v2c9D5QIhAJTAi2Kd3R8W0lDzt61EFZ+4CsGNLX6pn7QPv5/Dl37Q","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33753},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"609632d57f4181fce7c1d1f8e957104f5a9d2f51","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"test":"bun test tests/","build":"rm -rf dist && bun build src/index.ts --outdir dist --sourcemap --target=bun && tsc --project tsconfig.build.json","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run format && bun run check:package && bun publish","typecheck":"tsc --noEmit","check:package":"bun run typecheck && bun run build && bun run test"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-PIGF6ILN78WQNLoiY3rNL6knkCUB+ApQrL1Adudd+85BG7xMnErvQ39/4CqjpmnrjwuFTVIs6HAkXYH9/G2ACw==","repository":{"url":"git+https://github.com/absolutejs/metering.git","type":"git"},"_npmVersion":"10.8.3","description":"Per-tenant cost-attribution + budget enforcement for multi-tenant runtimes. Consumes handlerMetrics from @absolutejs/sync and spawn/idle/exit events from @absolutejs/runtime; rolls up CPU-ms, bytes egress, hibernation-GB-seconds per tenant; trips a circui","directories":{},"_nodeVersion":"24.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.8.3","@types/bun":"^1.3.14","typescript":"^6.0.3"},"peerDependencies":{"bun-types":"^1.3.14"},"_npmOperationalInternal":{"tmp":"tmp/metering_0.0.1_1780081743254_0.4582102047250025","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@absolutejs/metering","version":"0.1.0","keywords":["absolutejs","bun","paas","multi-tenant","metering","billing","cost-attribution","circuit-breaker"],"author":"Alex Kahn","license":"BSL-1.1","_id":"@absolutejs/metering@0.1.0","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"dist":{"shasum":"8048402a5f934718848a4034ff90b9b10835153f","tarball":"https://registry.npmjs.org/@absolutejs/metering/-/metering-0.1.0.tgz","fileCount":6,"integrity":"sha512-7wQRZdqkYRJof+n0vqkJFs/HMpcglW96eh9KtbTRbZTSS1J+IbcVosnC97o5qyHToX3Y3kwc8RkM+Y175eErIg==","signatures":[{"sig":"MEYCIQDD6302sumbuWMfV9/60qNpsNqdJsZrGZuFHPEvDJBCwQIhAKQotA7Mg5vVLhshdes2EJ26ieSlrUSSLMNvcwSA/Atz","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":62499},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"8048402a5f934718848a4034ff90b9b10835153f","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"test":"bun test tests/","build":"rm -rf dist && bun build src/index.ts --outdir dist --sourcemap --target=bun && tsc --project tsconfig.build.json","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run format && bun run check:package && bun publish","typecheck":"tsc --noEmit","check:package":"bun run typecheck && bun run build && bun run test"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-7wQRZdqkYRJof+n0vqkJFs/HMpcglW96eh9KtbTRbZTSS1J+IbcVosnC97o5qyHToX3Y3kwc8RkM+Y175eErIg==","repository":{"url":"git+https://github.com/absolutejs/metering.git","type":"git"},"_npmVersion":"10.8.3","description":"Per-tenant cost-attribution + budget enforcement for multi-tenant runtimes. Consumes handlerMetrics from @absolutejs/sync and spawn/idle/exit events from @absolutejs/runtime; rolls up CPU-ms, bytes egress, hibernation-GB-seconds per tenant; trips a circui","directories":{},"_nodeVersion":"24.3.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.8.3","@types/bun":"^1.3.14","typescript":"^6.0.3"},"peerDependencies":{"bun-types":"^1.3.14"},"_npmOperationalInternal":{"tmp":"tmp/metering_0.1.0_1780085221194_0.5677002234081614","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@absolutejs/metering","version":"0.1.1","keywords":["absolutejs","bun","paas","multi-tenant","metering","billing","cost-attribution","circuit-breaker"],"author":"Alex Kahn","license":"BSL-1.1","_id":"@absolutejs/metering@0.1.1","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/metering","bugs":{"url":"https://github.com/absolutejs/metering/issues"},"dist":{"shasum":"47f03839f1281407b8a6ba4ae2a09db38df92c3d","tarball":"https://registry.npmjs.org/@absolutejs/metering/-/metering-0.1.1.tgz","fileCount":10,"integrity":"sha512-puliXwWUYjsCbXvwBtwcw0IX/B3fjILxq1Igml+lER4jlEIzU7WsoutJnNmV3VOMfnuUEwyr4T9gbWCVKoFDQw==","signatures":[{"sig":"MEUCIQDDDx+QoLj5gBXg8AEB5sjz1HE7rqeYN8DpUSVBn0ZgtwIgYyk9rwqbNYFxkWvOJvp/5UkMS2CGH593tSbgRG3izY8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1163658},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"47f03839f1281407b8a6ba4ae2a09db38df92c3d","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js","default":"./dist/manifest.js"},"./manifest.json":"./dist/manifest.json"},"scripts":{"test":"bun test tests/","build":"rm -rf dist && bun build src/index.ts src/manifest.ts --root ./src --outdir dist --sourcemap --target=bun && tsc --project tsconfig.build.json && absolute-manifest emit","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run format && bun run check:package && bun publish","typecheck":"tsc --noEmit","check:package":"bun run typecheck && bun run build && bun run test"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-puliXwWUYjsCbXvwBtwcw0IX/B3fjILxq1Igml+lER4jlEIzU7WsoutJnNmV3VOMfnuUEwyr4T9gbWCVKoFDQw==","absolutejs":{"manifestContract":1},"repository":{"url":"git+https://github.com/absolutejs/metering.git","type":"git"},"_npmVersion":"10.8.3","description":"Per-tenant cost-attribution + budget enforcement for multi-tenant runtimes. Consumes handlerMetrics from @absolutejs/sync and spawn/idle/exit events from @absolutejs/runtime; rolls up CPU-ms, bytes egress, hibernation-GB-seconds per tenant; trips a circui","directories":{},"_nodeVersion":"24.3.0","dependencies":{"@sinclair/typebox":"^0.34.0","@absolutejs/manifest":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.8.3","@types/bun":"^1.3.14","typescript":"^6.0.3"},"peerDependencies":{"bun-types":"^1.3.14"},"_npmOperationalInternal":{"tmp":"tmp/metering_0.1.1_1783964324836_0.15218047236270227","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@absolutejs/metering","version":"0.2.0","keywords":["absolutejs","bun","paas","multi-tenant","metering","billing","cost-attribution","circuit-breaker"],"author":"Alex Kahn","license":"BSL-1.1","_id":"@absolutejs/metering@0.2.0","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/metering","bugs":{"url":"https://github.com/absolutejs/metering/issues"},"dist":{"shasum":"9a2cf457524ce886d566a100f35291ac688db63a","tarball":"https://registry.npmjs.org/@absolutejs/metering/-/metering-0.2.0.tgz","fileCount":10,"integrity":"sha512-0+d5HIcuBst3W2wlQYsEaSz5G2q36vxIRIYOhxPdzyhLH3lesdx0ZSlkk+JrHaZ+03ZZQoTd0kbiGbfGUAuGqQ==","signatures":[{"sig":"MEUCIA2UstgDGRkcCUUILwHYNPIR2t5zr9XpRMNwtuqukD6jAiEAoHMyIrVVR/Pz7bJTRzCGoFGe91DX0ezSz79Ps3CGV60=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1176269},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"9a2cf457524ce886d566a100f35291ac688db63a","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js","default":"./dist/manifest.js"},"./manifest.json":"./dist/manifest.json"},"scripts":{"test":"bun test tests/","build":"rm -rf dist && bun build src/index.ts src/manifest.ts --root ./src --outdir dist --sourcemap --target=bun && tsc --project tsconfig.build.json && absolute-manifest emit","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run format && bun run check:package && bun publish","typecheck":"tsc --noEmit","check:package":"bun run typecheck && bun run build && bun run test"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-0+d5HIcuBst3W2wlQYsEaSz5G2q36vxIRIYOhxPdzyhLH3lesdx0ZSlkk+JrHaZ+03ZZQoTd0kbiGbfGUAuGqQ==","absolutejs":{"manifestContract":1},"repository":{"url":"git+https://github.com/absolutejs/metering.git","type":"git"},"_npmVersion":"10.8.3","description":"Per-tenant cost-attribution + budget enforcement for multi-tenant runtimes. Consumes handlerMetrics from @absolutejs/sync and spawn/idle/exit events from @absolutejs/runtime; rolls up CPU-ms, bytes egress, hibernation-GB-seconds per tenant; trips a circui","directories":{},"_nodeVersion":"24.3.0","dependencies":{"@sinclair/typebox":"^0.34.0","@absolutejs/manifest":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.8.3","@types/bun":"^1.3.14","typescript":"^6.0.3"},"peerDependencies":{"bun-types":"^1.3.14"},"_npmOperationalInternal":{"tmp":"tmp/metering_0.2.0_1784020014366_0.23415894217894917","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@absolutejs/metering","version":"0.3.0","keywords":["absolutejs","bun","paas","multi-tenant","metering","billing","cost-attribution","circuit-breaker"],"author":"Alex Kahn","license":"BSL-1.1","_id":"@absolutejs/metering@0.3.0","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/metering","bugs":{"url":"https://github.com/absolutejs/metering/issues"},"dist":{"shasum":"82bbc74b86fd3545ee91fd6bce936d85b64869d2","tarball":"https://registry.npmjs.org/@absolutejs/metering/-/metering-0.3.0.tgz","fileCount":10,"integrity":"sha512-LHmbXIEqg5n+neFOXzaFBSltgsZeqGLyXA4SP1+lvK7NCJOJ2082RRW5LArVRw1MXi9ChXgVYgeo7Cc0Ty8BsQ==","signatures":[{"sig":"MEUCIEEXWLopQDXCFpXRz796VXy8AXj/LjR/ndrqymZqTM7DAiEAlkQ9lf88PycsF0AZCiKcpjxxgNr+XmRroWpVmGdAipk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1176754},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"82bbc74b86fd3545ee91fd6bce936d85b64869d2","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js","default":"./dist/manifest.js"},"./manifest.json":"./dist/manifest.json"},"scripts":{"test":"bun test tests/","build":"rm -rf dist && bun build src/index.ts src/manifest.ts --root ./src --outdir dist --sourcemap --target=bun && tsc --project tsconfig.build.json && absolute-manifest emit","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run format && bun run check:package && bun publish","typecheck":"tsc --noEmit","check:package":"bun run typecheck && bun run build && bun run test"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-LHmbXIEqg5n+neFOXzaFBSltgsZeqGLyXA4SP1+lvK7NCJOJ2082RRW5LArVRw1MXi9ChXgVYgeo7Cc0Ty8BsQ==","absolutejs":{"manifestContract":1},"repository":{"url":"git+https://github.com/absolutejs/metering.git","type":"git"},"_npmVersion":"10.8.3","description":"Per-tenant cost-attribution + budget enforcement for multi-tenant runtimes. Consumes handlerMetrics from @absolutejs/sync and spawn/idle/exit events from @absolutejs/runtime; rolls up CPU-ms, bytes egress, hibernation-GB-seconds per tenant; trips a circui","directories":{},"_nodeVersion":"24.3.0","dependencies":{"@sinclair/typebox":"^0.34.0","@absolutejs/manifest":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.8.3","@types/bun":"^1.3.14","typescript":"^6.0.3"},"peerDependencies":{"bun-types":"^1.3.14"},"_npmOperationalInternal":{"tmp":"tmp/metering_0.3.0_1784091593479_0.6779177921929915","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@absolutejs/metering","version":"0.4.0","keywords":["absolutejs","bun","paas","multi-tenant","metering","billing","cost-attribution","circuit-breaker"],"author":"Alex Kahn","license":"BSL-1.1","_id":"@absolutejs/metering@0.4.0","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/metering","bugs":{"url":"https://github.com/absolutejs/metering/issues"},"dist":{"shasum":"f803737ad4dd0482d8178a6e17cd0013f86c13d4","tarball":"https://registry.npmjs.org/@absolutejs/metering/-/metering-0.4.0.tgz","fileCount":16,"integrity":"sha512-pGaSnxrDbKYxH1UYQn5zmB9sfNfb5sMEtBnQPo9bZo2m8MAOipVEM/gm2et1PKcOmApsSOzQZ3QizwTfLCD2bw==","signatures":[{"sig":"MEUCIQC98fjq3NBCgU5NtBh8ZqgjDwTGAdScrqG2uYFQv4uq+gIgOr5TimRCduaYC8yRD634LkidaKP8Gndg8tDSG5TgLGI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3479202},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"f803737ad4dd0482d8178a6e17cd0013f86c13d4","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./elysia":{"types":"./dist/elysia.d.ts","import":"./dist/elysia.js","default":"./dist/elysia.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js","default":"./dist/manifest.js"},"./reporter":{"types":"./dist/reporter.d.ts","import":"./dist/reporter.js","default":"./dist/reporter.js"},"./manifest.json":"./dist/manifest.json"},"scripts":{"test":"bun test tests/","build":"rm -rf dist && bun build src/index.ts src/reporter.ts src/elysia.ts src/manifest.ts --root ./src --outdir dist --sourcemap --target=bun && tsc --project tsconfig.build.json && absolute-manifest emit","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run format && bun run check:package && bun publish","typecheck":"tsc --noEmit","check:package":"bun run typecheck && bun run build && bun run test"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-pGaSnxrDbKYxH1UYQn5zmB9sfNfb5sMEtBnQPo9bZo2m8MAOipVEM/gm2et1PKcOmApsSOzQZ3QizwTfLCD2bw==","absolutejs":{"manifestContract":1},"repository":{"url":"git+https://github.com/absolutejs/metering.git","type":"git"},"_npmVersion":"10.8.3","description":"Per-tenant cost-attribution + budget enforcement for multi-tenant runtimes. Consumes handlerMetrics from @absolutejs/sync and spawn/idle/exit events from @absolutejs/runtime; rolls up CPU-ms, bytes egress, hibernation-GB-seconds per tenant; trips a circui","directories":{},"_nodeVersion":"24.3.0","dependencies":{"@sinclair/typebox":"^0.34.0","@absolutejs/manifest":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"elysia":"^1.4.21","prettier":"^3.8.3","@types/bun":"^1.3.14","typescript":"^6.0.3"},"peerDependencies":{"elysia":">=1.4.0","bun-types":"^1.3.14"},"peerDependenciesMeta":{"elysia":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/metering_0.4.0_1784184015999_0.06711795118582042","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"@absolutejs/metering","version":"0.4.1","keywords":["absolutejs","bun","paas","multi-tenant","metering","billing","cost-attribution","circuit-breaker"],"author":"Alex Kahn","license":"BSL-1.1","_id":"@absolutejs/metering@0.4.1","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/metering","bugs":{"url":"https://github.com/absolutejs/metering/issues"},"dist":{"shasum":"1e1577d3a545734b7b9284a6ced59bb15e7824b4","tarball":"https://registry.npmjs.org/@absolutejs/metering/-/metering-0.4.1.tgz","fileCount":16,"integrity":"sha512-sN2G6K0gSCuKARqBdGSzjMIP+fxvaYiwvhEpHAWKHWGzSkjVLsbvVkWPeZR8KETqmeSsBn8x3tTjJtmZVZSZwg==","signatures":[{"sig":"MEYCIQCdhGD/Lg2aj3sUxUjJmKNfHnh0gpswUFeEh1NGlT9uQQIhAPnsdLLcb3cAe/I0VinkFDCUkPipPOGKAoE5MjuDEF9k","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1197212},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"1e1577d3a545734b7b9284a6ced59bb15e7824b4","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./elysia":{"types":"./dist/elysia.d.ts","import":"./dist/elysia.js","default":"./dist/elysia.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js","default":"./dist/manifest.js"},"./reporter":{"types":"./dist/reporter.d.ts","import":"./dist/reporter.js","default":"./dist/reporter.js"},"./manifest.json":"./dist/manifest.json"},"scripts":{"test":"bun test tests/","build":"rm -rf dist && bun build src/index.ts src/reporter.ts src/elysia.ts src/manifest.ts --root ./src --outdir dist --sourcemap --target=bun --external elysia && tsc --project tsconfig.build.json && absolute-manifest emit","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run format && bun run check:package && bun publish","typecheck":"tsc --noEmit","check:package":"bun run typecheck && bun run build && bun run test"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-sN2G6K0gSCuKARqBdGSzjMIP+fxvaYiwvhEpHAWKHWGzSkjVLsbvVkWPeZR8KETqmeSsBn8x3tTjJtmZVZSZwg==","absolutejs":{"manifestContract":1},"repository":{"url":"git+https://github.com/absolutejs/metering.git","type":"git"},"_npmVersion":"10.8.3","description":"Per-tenant cost-attribution + budget enforcement for multi-tenant runtimes. Consumes handlerMetrics from @absolutejs/sync and spawn/idle/exit events from @absolutejs/runtime; rolls up CPU-ms, bytes egress, hibernation-GB-seconds per tenant; trips a circui","directories":{},"_nodeVersion":"24.3.0","dependencies":{"@sinclair/typebox":"^0.34.0","@absolutejs/manifest":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"elysia":"^1.4.21","prettier":"^3.8.3","@types/bun":"^1.3.14","typescript":"^6.0.3"},"peerDependencies":{"elysia":">=1.4.0","bun-types":"^1.3.14"},"peerDependenciesMeta":{"elysia":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/metering_0.4.1_1784185458358_0.36333614654202395","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@absolutejs/metering","version":"0.5.0","keywords":["absolutejs","bun","paas","multi-tenant","metering","billing","cost-attribution","circuit-breaker"],"author":{"name":"Alex Kahn"},"license":"BSL-1.1","_id":"@absolutejs/metering@0.5.0","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/metering","bugs":{"url":"https://github.com/absolutejs/metering/issues"},"dist":{"shasum":"242a1fb007d5f2f11a2db6649455d05a43c569e9","tarball":"https://registry.npmjs.org/@absolutejs/metering/-/metering-0.5.0.tgz","fileCount":16,"integrity":"sha512-YT02O70K5Hh+6S9ZDmoZU1tlX60MMVRfywJ12HRy15FOW6141wz8A1HCglxjBJaE3SVuFr3Ehgt5nzOjSIn/dA==","signatures":[{"sig":"MEQCIEfrJdLnVUxWNyJEmxv8MALaipzNJhpvZS0REWX+mGkEAiBEQBGbhbHwfGYd4iKv/JJ+oBz7jCZQ+aF9q242fg1mqw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1222958},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./elysia":{"types":"./dist/elysia.d.ts","import":"./dist/elysia.js","default":"./dist/elysia.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js","default":"./dist/manifest.js"},"./reporter":{"types":"./dist/reporter.d.ts","import":"./dist/reporter.js","default":"./dist/reporter.js"},"./manifest.json":"./dist/manifest.json"},"gitHead":"3ec3dfe315549afa487021e855ebafd33f9583b0","scripts":{"test":"bun test tests/","build":"rm -rf dist && bun build src/index.ts src/reporter.ts src/elysia.ts src/manifest.ts --root ./src --outdir dist --sourcemap --target=bun --external elysia && tsc --project tsconfig.build.json && absolute-manifest emit","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run format && bun run check:package && bun publish","typecheck":"tsc --noEmit","check:package":"bun run typecheck && bun run build && bun run test"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"absolutejs":{"manifestContract":2},"repository":{"url":"git+https://github.com/absolutejs/metering.git","type":"git"},"_npmVersion":"10.9.2","description":"Per-tenant cost-attribution + budget enforcement for multi-tenant runtimes. Consumes handlerMetrics from @absolutejs/sync and spawn/idle/exit events from @absolutejs/runtime; rolls up CPU-ms, bytes egress, hibernation-GB-seconds per tenant; trips a circui","directories":{},"_nodeVersion":"22.14.0","dependencies":{"@sinclair/typebox":"^0.34.0","@absolutejs/manifest":"^0.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"elysia":"^1.4.21","prettier":"^3.8.3","@types/bun":"^1.3.14","typescript":"^6.0.3"},"peerDependencies":{"elysia":">=1.4.0","bun-types":"^1.3.14"},"peerDependenciesMeta":{"elysia":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/metering_0.5.0_1784807185176_0.043672692180391604","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@absolutejs/metering","version":"0.6.0","keywords":["absolutejs","bun","paas","multi-tenant","metering","billing","cost-attribution","circuit-breaker"],"author":"Alex Kahn","license":"BSL-1.1","_id":"@absolutejs/metering@0.6.0","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/metering","bugs":{"url":"https://github.com/absolutejs/metering/issues"},"dist":{"shasum":"a7a0bdb07a104730528ba0bd550b3f0a120da8d7","tarball":"https://registry.npmjs.org/@absolutejs/metering/-/metering-0.6.0.tgz","fileCount":18,"integrity":"sha512-WIzU9o5WxxuePwtTX7bxp0+nnIEAzgZT11yDP+bOkSCvrM8b/bSbhaHqhiKDubCVeFz259tSk/nRPPybrAhH0A==","signatures":[{"sig":"MEYCIQDtXSnupNqrJ0bo/e1KUfLkyHxsb2mP16MHoHXU7K97ZwIhAPfrfd8yTy7QXJj4y1BvXwMr9MqodfWkjaq/4zWl0002","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1231006},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"a7a0bdb07a104730528ba0bd550b3f0a120da8d7","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./elysia":{"types":"./dist/elysia.d.ts","import":"./dist/elysia.js","default":"./dist/elysia.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js","default":"./dist/manifest.js"},"./reporter":{"types":"./dist/reporter.d.ts","import":"./dist/reporter.js","default":"./dist/reporter.js"},"./manifest.json":"./dist/manifest.json"},"scripts":{"test":"bun test tests/","build":"rm -rf dist && bun build src/index.ts src/reporter.ts src/elysia.ts src/manifest.ts --root ./src --outdir dist --sourcemap --target=bun --external elysia && tsc --project tsconfig.build.json && absolute-manifest emit","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run format && bun run check:package && bun publish","typecheck":"tsc --noEmit","check:package":"bun run typecheck && bun run build && bun run test"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-WIzU9o5WxxuePwtTX7bxp0+nnIEAzgZT11yDP+bOkSCvrM8b/bSbhaHqhiKDubCVeFz259tSk/nRPPybrAhH0A==","absolutejs":{"manifestContract":2},"repository":{"url":"git+https://github.com/absolutejs/metering.git","type":"git"},"_npmVersion":"10.8.3","description":"Per-tenant cost-attribution + budget enforcement for multi-tenant runtimes. Consumes handlerMetrics from @absolutejs/sync and spawn/idle/exit events from @absolutejs/runtime; rolls up CPU-ms, bytes egress, hibernation-GB-seconds per tenant; trips a circui","directories":{},"_nodeVersion":"24.3.0","dependencies":{"@sinclair/typebox":"^0.34.0","@absolutejs/manifest":"^0.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"elysia":"^1.4.21","prettier":"^3.8.3","@types/bun":"^1.3.14","typescript":"^6.0.3"},"peerDependencies":{"elysia":">=1.4.0","bun-types":"^1.3.14"},"peerDependenciesMeta":{"elysia":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/metering_0.6.0_1785475223228_0.4111159346156379","host":"s3://npm-registry-packages-npm-production"}},"0.6.1":{"name":"@absolutejs/metering","version":"0.6.1","keywords":["absolutejs","bun","paas","multi-tenant","metering","billing","cost-attribution","circuit-breaker"],"author":"Alex Kahn","license":"BSL-1.1","_id":"@absolutejs/metering@0.6.1","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/metering","bugs":{"url":"https://github.com/absolutejs/metering/issues"},"dist":{"shasum":"e28502d6376577d6a5d3e6e91fa35c0b1245fadb","tarball":"https://registry.npmjs.org/@absolutejs/metering/-/metering-0.6.1.tgz","fileCount":18,"integrity":"sha512-OJy56EVPumoUjEscq1l9ZmrIS/PB15jQ8OHtXf1S0zjdCgAzJeufhq+j4RHwY7+ApifOWPJfC32n4fgqCqosFQ==","signatures":[{"sig":"MEQCIBkRv8De68qVBKXLa+FaAHHjybyOWqkDo2KqfTFEuyQ5AiBM/XOmDd+3Ktg/yAtA2rdgsFA+DMI6va2lBnMHV0s94w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1232639},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"e28502d6376577d6a5d3e6e91fa35c0b1245fadb","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./elysia":{"types":"./dist/elysia.d.ts","import":"./dist/elysia.js","default":"./dist/elysia.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js","default":"./dist/manifest.js"},"./reporter":{"types":"./dist/reporter.d.ts","import":"./dist/reporter.js","default":"./dist/reporter.js"},"./manifest.json":"./dist/manifest.json"},"scripts":{"test":"bun test tests/","build":"rm -rf dist && bun build src/index.ts src/reporter.ts src/elysia.ts src/manifest.ts --root ./src --outdir dist --sourcemap --target=bun --external elysia && tsc --project tsconfig.build.json && absolute-manifest emit","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run format && bun run check:package && bun publish","typecheck":"tsc --noEmit","check:package":"bun run typecheck && bun run build && bun run test"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-OJy56EVPumoUjEscq1l9ZmrIS/PB15jQ8OHtXf1S0zjdCgAzJeufhq+j4RHwY7+ApifOWPJfC32n4fgqCqosFQ==","absolutejs":{"manifestContract":2},"repository":{"url":"git+https://github.com/absolutejs/metering.git","type":"git"},"_npmVersion":"10.8.3","description":"Per-tenant cost-attribution + budget enforcement for multi-tenant runtimes. Consumes handlerMetrics from @absolutejs/sync and spawn/idle/exit events from @absolutejs/runtime; rolls up CPU-ms, bytes egress, hibernation-GB-seconds per tenant; trips a circui","directories":{},"_nodeVersion":"24.3.0","dependencies":{"@sinclair/typebox":"^0.34.0","@absolutejs/manifest":"^0.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"elysia":"^1.4.21","prettier":"^3.8.3","@types/bun":"^1.3.14","typescript":"^6.0.3"},"peerDependencies":{"elysia":">=1.4.0","bun-types":"^1.3.14"},"peerDependenciesMeta":{"elysia":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/metering_0.6.1_1786571503046_0.03914131347577521","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"@absolutejs/metering","version":"0.7.0","description":"Per-tenant cost-attribution + budget enforcement for multi-tenant runtimes. Consumes handlerMetrics from @absolutejs/sync and spawn/idle/exit events from @absolutejs/runtime; rolls up CPU-ms, bytes egress, hibernation-GB-seconds per tenant; trips a circui","repository":{"type":"git","url":"git+https://github.com/absolutejs/metering.git"},"homepage":"https://github.com/absolutejs/metering","bugs":{"url":"https://github.com/absolutejs/metering/issues"},"main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","type":"module","license":"BSL-1.1","author":{"name":"Alex Kahn"},"publishConfig":{"access":"public"},"keywords":["absolutejs","bun","paas","multi-tenant","metering","billing","cost-attribution","circuit-breaker"],"scripts":{"build":"rm -rf dist && bun build src/index.ts src/reporter.ts src/elysia.ts src/manifest.ts --root ./src --outdir dist --sourcemap --target=bun --external elysia && tsc --project tsconfig.build.json && absolute-manifest emit","test":"bun test tests/","typecheck":"tsc --noEmit","format":"prettier --write \"./**/*.{ts,json,md}\"","check:package":"bun run typecheck && bun run build && bun run test","release":"bun run format && bun run check:package && bun publish"},"peerDependencies":{"bun-types":"^1.3.14","elysia":"^2.0.0-beta.6"},"peerDependenciesMeta":{"elysia":{"optional":true}},"devDependencies":{"@types/bun":"^1.3.14","elysia":"2.0.0-beta.6","exact-mirror":"1.2.4","prettier":"^3.8.3","typebox":"1.3.16","typescript":"^6.0.3"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./elysia":{"types":"./dist/elysia.d.ts","import":"./dist/elysia.js","default":"./dist/elysia.js"},"./reporter":{"types":"./dist/reporter.d.ts","import":"./dist/reporter.js","default":"./dist/reporter.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js","default":"./dist/manifest.js"},"./manifest.json":"./dist/manifest.json"},"dependencies":{"@absolutejs/manifest":"^0.9.0","@sinclair/typebox":"^0.34.0"},"absolutejs":{"manifestContract":2},"_id":"@absolutejs/metering@0.7.0","gitHead":"8f7b331468aecfbaaca77c9bc929d66c91640ba8","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-qUgS1w/dbT8fSduKLkbLJuQ5YoFwM9GveC7a5RVEztc39WPTBYpw8L3j1CE0wguVXqZ0iaZ1Pdc+kK/t4yNuKA==","shasum":"82817ec5d1500501964b495f7c3c010d3bcf5c11","tarball":"https://registry.npmjs.org/@absolutejs/metering/-/metering-0.7.0.tgz","fileCount":18,"unpackedSize":583144,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICYefAQGrpu4gjvOPTnf+z556K9XuvKJbUPoAjkcCiUFAiEAk/8b4rz+EIHsZsav9/BP3elTFWFwvNElRPjisDBrDZM="}]},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"directories":{},"maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/metering_0.7.0_1787188199569_0.6362898081892479"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-29T19:09:03.078Z","modified":"2026-08-20T01:09:59.897Z","0.0.1":"2026-05-29T19:09:03.426Z","0.1.0":"2026-05-29T20:07:01.349Z","0.1.1":"2026-07-13T17:38:45.077Z","0.2.0":"2026-07-14T09:06:54.507Z","0.3.0":"2026-07-15T04:59:53.646Z","0.4.0":"2026-07-16T06:40:16.155Z","0.4.1":"2026-07-16T07:04:18.562Z","0.5.0":"2026-07-23T11:46:25.358Z","0.6.0":"2026-07-31T05:20:23.398Z","0.6.1":"2026-08-12T21:51:43.225Z","0.7.0":"2026-08-20T01:09:59.727Z"},"bugs":{"url":"https://github.com/absolutejs/metering/issues"},"author":{"name":"Alex Kahn"},"license":"BSL-1.1","homepage":"https://github.com/absolutejs/metering","keywords":["absolutejs","bun","paas","multi-tenant","metering","billing","cost-attribution","circuit-breaker"],"repository":{"type":"git","url":"git+https://github.com/absolutejs/metering.git"},"description":"Per-tenant cost-attribution + budget enforcement for multi-tenant runtimes. Consumes handlerMetrics from @absolutejs/sync and spawn/idle/exit events from @absolutejs/runtime; rolls up CPU-ms, bytes egress, hibernation-GB-seconds per tenant; trips a circui","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"readme":"# @absolutejs/metering\n\nPer-tenant cost-attribution + budget enforcement for multi-tenant Bun runtimes.\n\nBuilt for PaaS providers that run many small Bun apps under one host. Consumes\n`handlerMetrics` from [`@absolutejs/sync`](https://github.com/absolutejs/sync)\nand lifecycle events from [`@absolutejs/runtime`](https://github.com/absolutejs/runtime),\nrolls them up per tenant, and trips a circuit breaker the moment any per-tenant\nbudget dimension is exceeded. The library SB-6 layer between the runtime and\nthe billing / observability pipeline downstream.\n\n```ts\nimport { createMeter, consoleSink } from \"@absolutejs/metering\";\n\nconst meter = createMeter({\n  sinks: [consoleSink, influxSink],\n  budgets: {\n    \"*\": { cpuMs: 60_000, requests: 10_000 }, // free-tier default\n    \"acme-prod\": { cpuMs: 600_000, requests: 1_000_000 }, // paid override\n  },\n  onBreach: ({ tenant, dimension, observed, limit }) => {\n    suspendAtRouter(tenant, { dimension, observed, limit });\n  },\n});\n\n// Wire it into a sync engine: sync handlerMetrics records → meter.record(...)\nsyncEngine.handlerMetrics = (record) => {\n  meter.record({\n    type: \"handler\",\n    tenant: currentTenantId(),\n    mutationName: record.mutationName,\n    durationMs: record.durationMs,\n    cpuMs: record.cpuMs,\n    heapBytes: record.heapBytes,\n    ok: record.ok,\n    errorName: record.errorName,\n  });\n};\n\n// And a runtime: spawn/idle-kill/exit transitions → meter.record(...)\nruntime.options.onTransition = (event) => {\n  meter.record({\n    type: \"process\",\n    tenant: event.key,\n    transition: event.type,\n    durationMs: event.durationMs,\n  });\n};\n\n// And @absolutejs/runtime@0.1.0's Linux observation events:\nruntime.options.onMetrics = (event) => {\n  if (event.type === \"observation\") {\n    meter.record({\n      type: \"observation\",\n      tenant: event.key,\n      cpuMs: event.cpuMs,\n      rssBytes: event.rssBytes,\n      at: event.at,\n    });\n  }\n};\n\n// Record one terminal AI agent run. `costMicros` is caller-calculated so model\n// pricing stays an operator policy instead of becoming stale library data.\nmeter.record({\n  type: \"ai\",\n  tenant: tenantId,\n  requestId,\n  provider: \"anthropic\",\n  model: \"claude-sonnet-4-6\",\n  inputTokens: finish.usage.inputTokens,\n  outputTokens: finish.usage.outputTokens,\n  cacheReadInputTokens: finish.usage.cacheReadInputTokens,\n  cacheWriteInputTokens: finish.usage.cacheWriteInputTokens,\n  durationMs: finish.durationMs,\n  turns: finish.turns,\n  costMicros,\n  ok: finish.reason === \"complete\",\n  stopReason: finish.reason,\n});\n\n// Inside a hosted workload, hand handler/request events to the authenticated\n// host-local collector. The PaaS injects this endpoint, token, and per-process\n// source id; no tenant id is accepted from application code.\nimport { createWorkloadMeterReporter } from \"@absolutejs/metering/reporter\";\nimport { workloadMeterElysia } from \"@absolutejs/metering/elysia\";\n\nconst reporter = createWorkloadMeterReporter({\n  endpoint: process.env.ABSOLUTE_METER_ENDPOINT!,\n  sourceId: process.env.ABSOLUTE_METER_SOURCE_ID!,\n  token: process.env.ABSOLUTE_METER_TOKEN!,\n});\nconst app = new Elysia().use(workloadMeterElysia({ reporter }));\nsyncEngine.handlerMetrics = reporter.handlerMetrics;\n\n// In your request handler, gate on the meter:\nif (!meter.allow(tenantId))\n  return new Response(\"Quota exceeded\", { status: 429 });\n```\n\n## Surface (0.2.0)\n\n| API                                             | Purpose                                                                                                                                                                       |\n| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `createMeter(options)`                          | Factory. Returns a `Meter`.                                                                                                                                                   |\n| `meter.record(event)`                           | Accept one `MeterEvent` — `handler`, `process`, `observation`, or `ai`. Updates the rollup, fans out to sinks, may trip the breaker.                                          |\n| `meter.allow(tenant)`                           | Pre-flight gate. Returns `false` if any cumulative budget tripped, any rolling-window rule is currently over, or `reset()` hasn't been called after a sticky cumulative trip. |\n| `meter.usage(tenant)`                           | Snapshot of the rollup: `cpuMs`, `processCpuMs`, `bytesEgress`, `hibernationGbSeconds`, `processRssBytesPeak`, etc.                                                           |\n| `meter.rollingSum(tenant, dimension, windowMs)` | Current rolling-window total for `(tenant, dimension, window)`. For customer-facing \"you have N requests left in this window\" displays.                                       |\n| `meter.rollingFor(tenant)`                      | Active rolling rules.                                                                                                                                                         |\n| `meter.reset(tenant)`                           | Clear a cumulative-trip breaker without zeroing accumulated usage. Rolling-window trips auto-clear as events drain.                                                           |\n| `meter.clear(tenant)`                           | Zero accumulated usage AND clear the breaker.                                                                                                                                 |\n| `meter.tenants()`                               | Every tenant seen so far.                                                                                                                                                     |\n| `meter.budget(tenant)`                          | Active cumulative budget.                                                                                                                                                     |\n| `meter.tripped(tenant)`                         | Re-evaluates rolling rules; calling it can untrip a tenant whose window has drained.                                                                                          |\n| `meter.snapshot()` / `restore(snap)`            | Serializable point-in-time state. Survive shard restarts; the bill doesn't reset to zero.                                                                                     |\n| `meter.dispose()`                               | Await every sink's `flush?`, then `close?`.                                                                                                                                   |\n\n### Sinks\n\nA `MeterSink` is either a function `(event) => void | Promise<void>` or an object\n`{ ingest, flush?, close? }`. Sinks are fanned out in order. **A throw or\nrejection from one sink does not stop later sinks** — the meter is on the\nbilling critical path. The error is logged to stderr; the recorder keeps going.\n\nOn `dispose()`, every object-shaped sink's `flush()` is awaited (serial across\nsinks), then every `close()` is awaited. A throwing flush is logged + swallowed;\nlater sinks still flush. This is what batched adapters (Stripe, Influx, ClickHouse)\nneed to not drop the last few events on shutdown.\n\nBundled: `consoleSink`. Adapters for Influx / Prometheus / Stripe ship later as\nsibling packages.\n\n### Cumulative budgets\n\n`budgets['*']` is the default; per-tenant entries override it. Any dimension\nhitting its limit trips the breaker; `onBreach` fires **once per trip** (call\n`reset()` to re-arm). Subsequent events still accumulate — the bill keeps\ngrowing even after the gate is closed, which matches how real billing works.\n\nDimensions: `cpuMs`, `processCpuMs`, `bytesEgress`, `requests`, `errors`, `hibernationGbSeconds`, `aiRequests`, `aiInputTokens`, `aiOutputTokens`, `aiCostMicros`.\n\n### Rolling-window budgets\n\n```ts\ncreateMeter({\n  rollingBudgets: {\n    \"*\": [\n      { dimension: \"errors\", windowMs: 5 * 60_000, limit: 50 }, // 50 errors / 5 min trips the breaker\n      { dimension: \"requests\", windowMs: 1 * 60_000, limit: 1_000 }, // 1k req / min rate cap\n    ],\n    \"acme-prod\": [\n      { dimension: \"cpuMs\", windowMs: 60_000, limit: 50_000 }, // 50s sandbox CPU / minute\n    ],\n  },\n});\n```\n\nA rolling-window rule trips when the rolling sum reaches `limit`. **It re-closes\nautomatically** as events drain out of the window — no `reset()` needed. That's\nthe difference from a cumulative budget, which sticks until `reset()`. Both\nkinds can be set on the same tenant; `allow()` is `false` if any rule trips.\n\n### Observation accounting\n\n`@absolutejs/runtime@0.1.0` emits `{ type: 'observation', cpuMs, rssBytes }` on\na configurable interval. The meter treats `cpuMs` as CUMULATIVE since spawn and\ncharges the delta since the previous observation. A `process` event of\n`transition === 'spawn'`, `'adopt'`, `'restored'`, or `'exit'` resets the\nbaseline so a fresh or newly supervised process doesn't double-charge. Only a\nreal `spawn` increments the spawn counter.\n\n### Hibernation accounting\n\n`@absolutejs/runtime` emits `idle-kill` / `lru-evict` transitions; the metering\ncaller is responsible for computing the GB-seconds the tenant racks up while\nhibernated and passing it as `hibernationGbSeconds` on the `process` event.\nThe meter sums the values it sees — it does not infer them.\n\n### Snapshot + restore\n\n```ts\nconst json = JSON.stringify(meter.snapshot());\nawait persistToDisk('/var/lib/meter/state.json', json);\n\n// On shard restart:\nconst restored = createMeter({ ... same config ... });\nrestored.restore(JSON.parse(await readFromDisk('/var/lib/meter/state.json')));\n```\n\nThe snapshot captures every tenant's usage, tripped state, rolling-window state,\nand the last observation cpuMs baseline so the next observation charges a\nsensible delta instead of jumping to the cumulative-since-process-start value.\n\n## Architectural role\n\n- **`@absolutejs/sync`** — emits `handlerMetrics` records on every sandboxed mutation.\n- **`@absolutejs/runtime`** — emits lifecycle events on every spawn / idle-kill / exit.\n- **`@absolutejs/metering`** — _this library_. Rolls those up per tenant + gates them.\n- **`@absolutejs/router`** (planned) — consumes `meter.allow()` to refuse traffic for over-quota tenants at the edge.\n\n## License\n\nBSL 1.1 with a named carveout for the hosted multi-tenant metering / cost-attribution / per-tenant billing category (Stripe Metered Billing, Orb, Metronome, Lago, Amberflo, Cloudflare Workers billing, Convex usage dashboards, Vercel usage dashboards). See [LICENSE](./LICENSE). Change Date: 4 years from first release; Change License: Apache 2.0.\n","readmeFilename":"README.md"}