{"_id":"overload-protection","_rev":"13-260e9e85c4bbf22cbf78d861c1779847","name":"overload-protection","description":"Load detection and shedding capabilities for http, express, restify and koa","dist-tags":{"latest":"1.2.3"},"versions":{"1.0.0":{"name":"overload-protection","version":"1.0.0","main":"index.js","scripts":{"test":"tap test","lint":"standard","ci":"npm run lint && npm run cov","cov":"tap --cov test","covr":"tap --coverage-report=html test","benchmarks":"ls benchmarks | while read l; do node benchmarks/$l; done"},"pre-commit":["test","lint"],"keywords":["load shedding","overload protection","production monitoring","503","Service Unavailable","Server Unavailable","HTTP 503","heavy load","load","protection","shedding","express","fastify","http","koa","restify"],"author":{"name":"David Mark Clements","email":"huperekchuno@googlemail.com"},"license":"MIT","devDependencies":{"autocannon":"^0.16.5","express":"^4.16.2","fastify":"^0.33.0","koa":"^2.3.0","koa-router":"^7.2.1","pre-commit":"^1.2.2","restify":"^6.3.1","standard":"^10.0.3","tap":"^10.7.2"},"dependencies":{"loopbench":"^1.2.0"},"directories":{"lib":"lib","test":"test"},"repository":{"type":"git","url":"git+https://github.com/davidmarkclements/overload-protection.git"},"bugs":{"url":"https://github.com/davidmarkclements/overload-protection/issues"},"homepage":"https://github.com/davidmarkclements/overload-protection#readme","description":"Load detection and shedding capabilities for http, express, restify, fastify and koa","gitHead":"ac0e0edd107bd8216880ec04a80b5a61064e9baf","_id":"overload-protection@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},"dist":{"integrity":"sha512-mvkjsrrMh8cI8sEyfyxzVcXxKpklyoMZKhsQgVQfh8wPGwwF9TF4lK5BP/nOjRUx7j12ARPcVIFWKXoYoqldFA==","shasum":"c62d7b175873f681234805c788b307f97cb996c9","tarball":"https://registry.npmjs.org/overload-protection/-/overload-protection-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYUe1pDbva/8bKMgCPWEhNoaTUhzhiGeTKusNT40NidQIhAMrwqejyUC9xE1jaVADrmgLjtawsVylcow2K87u8Dov3"}]},"maintainers":[{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/overload-protection-1.0.0.tgz_1510664411173_0.6662079088855535"}},"1.0.1":{"name":"overload-protection","version":"1.0.1","main":"index.js","scripts":{"test":"tap test","lint":"standard","ci":"npm run lint && npm run cov","cov":"tap --cov test","covr":"tap --coverage-report=html test","benchmarks":"ls benchmarks | while read l; do node benchmarks/$l; done"},"pre-commit":["test","lint"],"keywords":["load shedding","overload protection","production monitoring","503","Service Unavailable","Server Unavailable","HTTP 503","heavy load","load","protection","shedding","express","fastify","http","koa","restify"],"author":{"name":"David Mark Clements","email":"huperekchuno@googlemail.com"},"license":"MIT","devDependencies":{"autocannon":"^0.16.5","express":"^4.16.2","fastify":"^0.33.0","koa":"^2.3.0","koa-router":"^7.2.1","pre-commit":"^1.2.2","restify":"^6.3.1","standard":"^10.0.3","tap":"^10.7.2"},"dependencies":{"loopbench":"^1.2.0"},"directories":{"lib":"lib","test":"test"},"repository":{"type":"git","url":"git+https://github.com/davidmarkclements/overload-protection.git"},"bugs":{"url":"https://github.com/davidmarkclements/overload-protection/issues"},"homepage":"https://github.com/davidmarkclements/overload-protection#readme","description":"Load detection and shedding capabilities for http, express, restify, fastify and koa","gitHead":"835096f321512b55653e3414d1626508838a240d","_id":"overload-protection@1.0.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},"dist":{"integrity":"sha512-XwnNOoaRbLxHaSaSo7KOtRPMs6YT3onALvvnPcE27vB6DN0ft0U+ARn5PjPQhyH6Wpj75ZMnPLAjxqrx/6nVaA==","shasum":"7507f3ad53ec897ad4fa9e50bf25f1f80400acc1","tarball":"https://registry.npmjs.org/overload-protection/-/overload-protection-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrGhmrTm7gJBSCf7yys8Kpcv3Ec+xn4Sr461kyjpzBRAIhANWlnzREsuB1TLiLijwujVkPuMMton/h5n94DAF2KqRH"}]},"maintainers":[{"email":"hello@matteocollina.com","name":"matteo.collina"},{"email":"huperekchuno@googlemail.com","name":"davidmarkclements"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/overload-protection-1.0.1.tgz_1510664900433_0.8768718461506069"}},"1.0.2":{"name":"overload-protection","version":"1.0.2","main":"index.js","scripts":{"test":"tap test","lint":"standard","ci":"npm run lint && npm run cov","cov":"tap --cov test","covr":"tap --coverage-report=html test","benchmarks":"ls benchmarks | while read l; do node benchmarks/$l; done"},"pre-commit":["test","lint"],"keywords":["load shedding","overload protection","production monitoring","503","Service Unavailable","Server Unavailable","HTTP 503","heavy load","load","protection","shedding","express","fastify","http","koa","restify"],"author":{"name":"David Mark Clements","email":"huperekchuno@googlemail.com"},"license":"MIT","devDependencies":{"autocannon":"^0.16.5","express":"^4.16.2","koa":"^2.3.0","koa-router":"^7.2.1","pre-commit":"^1.2.2","restify":"^6.3.1","standard":"^10.0.3","tap":"^10.7.2"},"dependencies":{"loopbench":"^1.2.0"},"directories":{"lib":"lib","test":"test"},"repository":{"type":"git","url":"git+https://github.com/davidmarkclements/overload-protection.git"},"bugs":{"url":"https://github.com/davidmarkclements/overload-protection/issues"},"homepage":"https://github.com/davidmarkclements/overload-protection#readme","description":"Load detection and shedding capabilities for http, express, restify and koa","gitHead":"d572cc09e35a3876366e6e3506c51cd467ba914d","_id":"overload-protection@1.0.2","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},"dist":{"integrity":"sha512-fAB1uyeEagv+EuPoiu9FdHNDwNLX1E9oYFoyLqNIOJZniyRCSK97EvGY0tkED8pC2wBmAFwGgrMob2NEUVvsFA==","shasum":"eb281bd8c822bf1dfc3fe6fe7ed1cba986c28c58","tarball":"https://registry.npmjs.org/overload-protection/-/overload-protection-1.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFpjtrbjlcoSp/eBZ1lAcbrxmpSaHTpo8LT4aT5rbD+4AiEA7BTVEcvumQiYZz2vUQjtyMSLgPnIjyqZprlGQUFhlHo="}]},"maintainers":[{"email":"hello@matteocollina.com","name":"matteo.collina"},{"email":"huperekchuno@googlemail.com","name":"davidmarkclements"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/overload-protection-1.0.2.tgz_1510675198955_0.5200158541556448"}},"1.1.0":{"name":"overload-protection","version":"1.1.0","main":"index.js","scripts":{"test":"tap test","lint":"standard","ci":"npm run lint && npm run cov","cov":"tap --cov test","covr":"tap --coverage-report=html test","benchmarks":"ls benchmarks | while read l; do node benchmarks/$l; done"},"pre-commit":["test","lint"],"keywords":["load shedding","overload protection","production monitoring","503","Service Unavailable","Server Unavailable","HTTP 503","heavy load","load","protection","shedding","express","fastify","http","koa","restify"],"author":{"name":"David Mark Clements","email":"huperekchuno@googlemail.com"},"license":"MIT","devDependencies":{"autocannon":"^0.16.5","express":"^4.16.2","koa":"^2.3.0","koa-router":"^7.2.1","pre-commit":"^1.2.2","restify":"^6.3.1","standard":"^10.0.3","tap":"^10.7.2"},"dependencies":{"loopbench":"^1.2.0"},"directories":{"lib":"lib","test":"test"},"repository":{"type":"git","url":"git+https://github.com/davidmarkclements/overload-protection.git"},"bugs":{"url":"https://github.com/davidmarkclements/overload-protection/issues"},"homepage":"https://github.com/davidmarkclements/overload-protection#readme","description":"Load detection and shedding capabilities for http, express, restify and koa","gitHead":"1707a585a4b7938eada58054ae007f07649cd7a4","_id":"overload-protection@1.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},"dist":{"integrity":"sha512-hgpWyJb7EQL4531wAa9eCbaEI326LnKHgtJH9Q88DeQ4tsXjyZZaqlrFCVCAfZ7rR4SVsS06SZxEHmxL/dHpnw==","shasum":"ec9fef435118ec40f2231782734b111469f7ce2b","tarball":"https://registry.npmjs.org/overload-protection/-/overload-protection-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDtsebYqlwrDFDcLny6HnoUGKUc1lrn2XKeTNI0sQgcSAiEAv1P6YrefyPjeYxzgLSBUH/Zt2WNUtr5j4NFcghr9MkA="}]},"maintainers":[{"email":"hello@matteocollina.com","name":"matteo.collina"},{"email":"huperekchuno@googlemail.com","name":"davidmarkclements"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/overload-protection-1.1.0.tgz_1510963664786_0.591212400002405"}},"1.2.0":{"name":"overload-protection","version":"1.2.0","main":"index.js","scripts":{"test":"tap test","lint":"standard","ci":"npm run lint && npm run cov","cov":"tap --cov test","covr":"tap --coverage-report=html test","benchmarks":"ls benchmarks | while read l; do node benchmarks/$l; done"},"pre-commit":["test","lint"],"keywords":["load shedding","overload protection","production monitoring","503","Service Unavailable","Server Unavailable","HTTP 503","heavy load","load","protection","shedding","express","fastify","http","koa","restify"],"author":{"name":"David Mark Clements","email":"huperekchuno@googlemail.com"},"license":"MIT","devDependencies":{"express":"^4.17.1","koa":"^2.11.0","koa-router":"^7.4.0","pre-commit":"^1.2.2","restify":"^8.5.1","standard":"^10.0.3","tap":"^10.7.2"},"dependencies":{"autocannon":"^4.4.1","loopbench":"^1.2.0"},"directories":{"lib":"lib","test":"test"},"repository":{"type":"git","url":"git+https://github.com/davidmarkclements/overload-protection.git"},"bugs":{"url":"https://github.com/davidmarkclements/overload-protection/issues"},"homepage":"https://github.com/davidmarkclements/overload-protection#readme","description":"Load detection and shedding capabilities for http, express, restify and koa","gitHead":"5e23737d281a4db42f7e60a89b949f8a80cb7dae","_id":"overload-protection@1.2.0","_nodeVersion":"12.14.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-hhRvlltNDHAs+HG3tG7m4lPdChtCiuMc3bmYN2pUIG01aVrMpliUqAuKKVDBdjY32Dn4eRyMWvvNzBdMJHeWvw==","shasum":"3499a00c315e22a77a9e9a87e1cde6df0b574a11","tarball":"https://registry.npmjs.org/overload-protection/-/overload-protection-1.2.0.tgz","fileCount":32,"unpackedSize":102684,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd++gjCRA9TVsSAnZWagAAiIEP/j+UD0Akgy1ea2Zke2+t\nxGbnG0bcqaFXPjakI+S0rrtQEnhT/DMKZO8STqi6K8KsrH+l8nTQVFXLLXF1\nUSO1ksv0HbFwcTFxTSscyLAs4vOmqbaTrI47NNJ/343pZuz7d0hbfDU5TRVq\nkh1cOESwlasMy+rbqTiRnl0u9jEjUV+2RqL9laIPXwBSV5pW5c2rjOw3njEj\nUmGKU7akeV5G6VP08w5j2joH6uQsU3H6PW8se9dzF8eu0xJixthwzJQQQxSP\nws2/Snrt6f3Loy7YwTpQegFXM3ADhc14m0eS3+xPl9BN+U0t9zhSkT/ffsGX\n2IBVYfD/6CGJKVcBqRSt/kR9pXsbo1RIEh5B3Ym6dl+50F0G6aZtCSkf5y2q\nb5jg43X/IDzFBL3y7blAcQKT70PfTEinAspu+GfGTarxvyjJCwh3Iq3kMz9g\nN3AQRJDKNw5P0oubxl8ijK/9Rw2RXZmBMEc5iqqQfvTSVAAPDDb8I2BwdvCn\ns0qu0DDcAgsrOtTG9RopXXtW+nyG0i/M/lvaMVSus3YV2Rf1V7XsD32chw8F\nBmVLFc7xOOGOu5lsWcccjgBCCWfI8OEeH0YX8m0kjAqr4fYWwZjFvVT5MUnE\njCzIutbKEb1LEcfjFPly8I4z92mjdOU3RmW8UP/M/8eke/4MmR2T7v1DAUZU\nuwQ5\r\n=Q+EZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFf1n2aBmShSlI2gZtAH/AMJJIxairnt7s9Chte+jm9nAiAVEN4776m8dnqdJ/6rLMVrHC2XIOlnJ4fEM/H9IndkUQ=="}]},"maintainers":[{"email":"huperekchuno@googlemail.com","name":"davidmarkclements"},{"email":"hello@matteocollina.com","name":"matteo.collina"}],"_npmUser":{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/overload-protection_1.2.0_1576790051562_0.8090298540988103"},"_hasShrinkwrap":false},"1.2.1":{"name":"overload-protection","version":"1.2.1","main":"index.js","scripts":{"test":"tap test","lint":"standard","ci":"npm run lint && npm run cov","cov":"tap --cov test","covr":"tap --coverage-report=html test","benchmarks":"ls benchmarks | while read l; do node benchmarks/$l; done"},"pre-commit":["test","lint"],"keywords":["load shedding","overload protection","production monitoring","503","Service Unavailable","Server Unavailable","HTTP 503","heavy load","load","protection","shedding","express","fastify","http","koa","restify"],"author":{"name":"David Mark Clements","email":"huperekchuno@googlemail.com"},"license":"MIT","devDependencies":{"express":"^4.17.1","koa":"^2.11.0","koa-router":"^7.4.0","pre-commit":"^1.2.2","restify":"^8.5.1","standard":"^10.0.3","tap":"^10.7.2"},"dependencies":{"autocannon":"^4.4.1","loopbench":"^1.2.0"},"directories":{"lib":"lib","test":"test"},"repository":{"type":"git","url":"git+https://github.com/davidmarkclements/overload-protection.git"},"bugs":{"url":"https://github.com/davidmarkclements/overload-protection/issues"},"homepage":"https://github.com/davidmarkclements/overload-protection#readme","description":"Load detection and shedding capabilities for http, express, restify and koa","gitHead":"04726300b2c3dc22d28661d481d62598cab6d29b","_id":"overload-protection@1.2.1","_nodeVersion":"12.14.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-aIOgq7XgldkBL9cp5jkA/mfNAuik0NZvVaBlpJhST+fepq3wYAmoQRpJjfG6AY5wwToGoUPs6ePPwffh1q4n+A==","shasum":"89f8a3fa1beed0384923bf8bcb745e22539fc9f7","tarball":"https://registry.npmjs.org/overload-protection/-/overload-protection-1.2.1.tgz","fileCount":32,"unpackedSize":102686,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd++ilCRA9TVsSAnZWagAAMp8QAJJbTD/pkLVRnRBn0vYR\naWCVhAZ782eZ2RpA+j5QFR7XtQ1XE8ROAyFI7CYMBzDrMHWPT14D7ZbUaHBx\nF9U+V/SbZTm7c3aZuX/zX4yCFUlya04ovMnIwe7r2VblVG9rJllQTxipeRrf\n6lnZBSTEpCJxm6ncNk1xpgCOiqmEdg4QyZe1pwwtatASs6lmU7aqKdkPFiJx\nxHIeFvM6s5fhYu/Xac7//FRjYF5H2Nxa3M0PK88ACR1mKVZgbguRnzyj3pG7\nhLDlZCSPvv7V5w8z7t1KzozYVoP4jGcu8prjDgIKENtKhvowDksopGj2A/RE\nPwWcfdENuHrfmdLCCWpB3xeEop3jY6ZG4IzM1nBDICWTochAedsb29Sy+BSi\n6JpoqmYx+t/Ezn8VDqvC4aUnkshROKsWdw2itZZ9XNFOECoiOsV64RqGHUIp\n/YUezveS8EUpHSjnT6Kxo+lkFB5ZGmgOWnDdL3O0G1VVgDDy6RU4MxUoHwc3\n91Jj1AaMxS5QOZqft6eGrspUvZv4roRAjAny/LZvstzUfcQaOeb/re29Auzd\nLPn0yagucLhQCxHvFCpKA1zyU0dkpEUT+u3fyDeWKoLiIwKR74DRnFSl/yhZ\nneIsYv2Hgm+Rj/B+gSkh6c2SQh+x7CQCtifX9gDdAp32eueXi9QDSpFzGegn\nRZTd\r\n=Fg01\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2CyuCc7KJcHbxBuaqyt6bUkeMIj8MGUMDOaYVQU2HswIgSPY60nYPNCfX0zLAezdRicHrsclQmlUK64lK/CWNZGI="}]},"maintainers":[{"email":"huperekchuno@googlemail.com","name":"davidmarkclements"},{"email":"hello@matteocollina.com","name":"matteo.collina"}],"_npmUser":{"name":"davidmarkclements","email":"huperekchuno@googlemail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/overload-protection_1.2.1_1576790181509_0.24165066132414803"},"_hasShrinkwrap":false},"1.2.2":{"name":"overload-protection","version":"1.2.2","main":"index.js","scripts":{"test":"tap test","lint":"standard","ci":"npm run lint && npm run cov","cov":"tap --cov test","covr":"tap --coverage-report=html test","benchmarks":"ls benchmarks | while read l; do node benchmarks/$l; done"},"pre-commit":["test","lint"],"keywords":["load shedding","overload protection","production monitoring","503","Service Unavailable","Server Unavailable","HTTP 503","heavy load","load","protection","shedding","express","fastify","http","koa","restify"],"author":{"name":"David Mark Clements","email":"huperekchuno@googlemail.com"},"license":"MIT","devDependencies":{"express":"^4.17.1","koa":"^2.11.0","koa-router":"^7.4.0","pre-commit":"^1.2.2","restify":"^8.5.1","standard":"^10.0.3","tap":"^10.7.2"},"dependencies":{"autocannon":"^4.4.1","loopbench":"^1.2.0"},"directories":{"lib":"lib","test":"test"},"repository":{"type":"git","url":"git+https://github.com/davidmarkclements/overload-protection.git"},"bugs":{"url":"https://github.com/davidmarkclements/overload-protection/issues"},"homepage":"https://github.com/davidmarkclements/overload-protection#readme","description":"Load detection and shedding capabilities for http, express, restify and koa","gitHead":"64ccd6e44e399b1b8d1b52b2f78cc6a018d1c0d0","_id":"overload-protection@1.2.2","_nodeVersion":"16.10.0","_npmVersion":"7.24.0","dist":{"integrity":"sha512-v2Wjb0aynckBYwbrX7Gql34iLAuhgu7/dBqoyuQtLV44JBt3cecyCDWF2MkvdKnrgn/K+KHdEqCGYo4sc6EegA==","shasum":"fdc895d85ba5588d9318bc58c5765f451fbbce0e","tarball":"https://registry.npmjs.org/overload-protection/-/overload-protection-1.2.2.tgz","fileCount":32,"unpackedSize":102675,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHFt17tZ3lpc+X4PZZhti948dqkzaDP0PRrd8qvfm0HJAiEA+1oBL+eqxDJxsXqkUxxHTUA8y6pgAN/NmRhtQLzuXZs="}]},"_npmUser":{"name":"davidmarkclements","email":"david.mark.clements@gmail.com"},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"davidmarkclements","email":"david.mark.clements@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/overload-protection_1.2.2_1633104538251_0.8937222228547146"},"_hasShrinkwrap":false},"1.2.3":{"name":"overload-protection","version":"1.2.3","main":"index.js","scripts":{"test":"tap test","lint":"standard","ci":"npm run lint && npm run cov","cov":"tap --cov test","covr":"tap --coverage-report=html test","benchmarks":"ls benchmarks | while read l; do node benchmarks/$l; done"},"pre-commit":["test","lint"],"keywords":["load shedding","overload protection","production monitoring","503","Service Unavailable","Server Unavailable","HTTP 503","heavy load","load","protection","shedding","express","fastify","http","koa","restify"],"author":{"name":"David Mark Clements","email":"huperekchuno@googlemail.com"},"license":"MIT","devDependencies":{"autocannon":"^4.4.1","express":"^4.17.1","koa":"^2.11.0","koa-router":"^7.4.0","pre-commit":"^1.2.2","restify":"^8.5.1","standard":"^10.0.3","tap":"^10.7.2"},"dependencies":{"loopbench":"^1.2.0"},"directories":{"lib":"lib","test":"test"},"repository":{"type":"git","url":"git+https://github.com/davidmarkclements/overload-protection.git"},"bugs":{"url":"https://github.com/davidmarkclements/overload-protection/issues"},"homepage":"https://github.com/davidmarkclements/overload-protection#readme","description":"Load detection and shedding capabilities for http, express, restify and koa","gitHead":"a6041db679311f3edda0ffc8d0b215dfbef1cbb2","_id":"overload-protection@1.2.3","_nodeVersion":"16.12.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-b7XZbmhujnqNoK0Z6NPzA/nhfQnE08ZTHSzzjTMwegb5N9oBAAApx3f9u2R/f3VGaACTQj6QJnGUfX1oFttqfg==","shasum":"a0e75845a1ccbc9ec9c6039936454ba35500b1ad","tarball":"https://registry.npmjs.org/overload-protection/-/overload-protection-1.2.3.tgz","fileCount":32,"unpackedSize":102675,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnQvZCRA9TVsSAnZWagAAHFsP/iWq1x1i53mvXXM4G/Ag\nqWG1Cs3+q/TbQVNIRlpXBiICakO6DASbi4W5ss2CEDfxCzN3x92ynif8uuyl\ny72yaAdLXYCl9+U03LNCwkj2YImJ9U+E3K2ijIv8OYbft94xTPHHsHR8tL1m\nZLWB8FsO0LGpYQL4Wd61S0jjB/QFPnqdb9rPJa4DCt2At/mgcXEI6NI5kOD4\nPF+X2SoxjPdJFyBwMc2vnmQqyhWojLX4rUPaP+JlDCXibmuszNkZ09qhp7DR\nVOEAchKUAwOzqrXla9DidQM5ILPJpPjXFfy0d8cZC/9nSK5DIgLQcgY7Q9PE\nMLKNdSU2L3mWIVyn8StfP1mIz+xsLDRwezbSelMVZYaxOLcjBmLxTFBBYMRk\nMN5aiDYzroDICr0TtdDQi+TKtGPHmBsIWdwUhP2k+huTNDs64GFESzRvAac5\n2nTsZEVBBXQKTvittDcj4Ndm9aXyGa1DO484dA5uqT4E0w2RSuxN/0IsrkVn\nJgJV6gI/1H0fsMJt62r4PF1MOOhCdjB+1QvkgHnJl4F2aErnxfls/7SrwCux\nQnJV5O1MWra9cUrPtWiafl2EySOGD/GU2BawfjIv2Pz+FMP5h4qseKeGmNsK\n73iuCEJbkfCxppO3OjaqzukuctMDuBCEEpd3v0OQcgaPp94W1yF29eHjAcXo\nL0Xy\r\n=02F5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHST9GvguuyouyWhJoDFb7LcUVOoOFyon7OzuWbR8LG2AiEA2r8mm1Af0A//OJSDlkDS2eUk8e82T1Ttu1gZQnDl1VE="}]},"_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"davidmarkclements","email":"david.mark.clements@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/overload-protection_1.2.3_1637682136990_0.6042892248365772"},"_hasShrinkwrap":false}},"readme":"# overload-protection \n\nLoad detection and shedding capabilities for http, express, restify, and koa\n\n[![Build Status](https://travis-ci.org/davidmarkclements/overload-protection.svg?branch=master)](https://travis-ci.org/davidmarkclements/overload-protection)\n[![Coverage Status](https://coveralls.io/repos/github/davidmarkclements/overload-protection/badge.svg)](https://coveralls.io/github/davidmarkclements/overload-protection)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n\n## About\n\n`overload-protection` provides integration for your framework of choice.\n\nIf a threshold is crossed for a given metric, `overload-protection` \nwill send an HTTP 503 Service Unavailable response, with (by default) \na `Retry-After` header, instructing the client (e.g. a browser or load balancer) to \nretry after a given amount of seconds.\n\nCurrent supported metrics are:\n\n* event loop delay (is the JavaScript thread blocking too long)\n* Used Heap Memory \n* Total Resident Set Size\n\nFor a great explanation of Used Heap Memory vs Resident Set Size see \nDaniel Khans article at <https://www.dynatrace.com/blog/understanding-garbage-collection-and-hunting-memory-leaks-in-node-js>   \n\n## Usage\n\nCreate a config object for your thresholds (and other `overload-protection`)\noptions.\n\n```js\nconst protectCfg = {\n  production: process.env.NODE_ENV === 'production', // if production is false, detailed error messages are exposed to the client\n  clientRetrySecs: 1, // Retry-After header, in seconds (0 to disable) [default 1]\n  sampleInterval: 5, // sample rate, milliseconds [default 5]\n  maxEventLoopDelay: 42, // maximum detected delay between event loop ticks [default 42]\n  maxHeapUsedBytes: 0, // maximum heap used threshold (0 to disable) [default 0]\n  maxRssBytes: 0, // maximum rss size threshold (0 to disable) [default 0]\n  errorPropagationMode: false // dictate behavior: take over the response \n                              // or propagate an error to the framework [default false]\n  logging: false, // set to string for log level or function to pass data to\n  logStatsOnReq: false // set to true to log stats on every requests\n}\n```\n\nThen pass the framework we're integrating with along with the configuration object.\n\nFor instance with Express we would do:\n\n```js\nconst app = require('express')()\nconst protect = require('overload-protection')('express', protectCfg)\napp.use(protect)\n```\n\nWith middleware based frameworks, always put the `overload-protection` middleware\nfirst. In default mode this means `overload-protection` will take over the response\nand prevent any other middleware from executing (thus taking further potential pressure off\nof the process).\n\nRestify, and Koa all work in much the same way, call the `overload-protection`\nmodule with the name of the framework, a config object and pass the resulting `protect`\ninstance to `app.use` – e.g. Koa would be:\n\n```js\nconst Koa = require('koa')\nconst protect = require('overload-protection')('koa', protectCfg)\nconst app = new Koa()\napp.use(protect)\n```\n\nFor pure core HTTP the `overload-protection` instance can be called\nat the top of the request handler function. With two arguments (just `req` and `res`)\nthe function will return `true` if protection/shedding has been provided, or `false`\nif not. If `overload-protection` *has* taken over (the `true` case), then we should\nexit the function and do no further work:\n\n```js\nconst http = require('http')\nconst protect = require('overload-protection')('http', protectCfg)\n\nhttp.createServer(function (req, res) {\n  if (protect(req, res) === true) return\n  res.end('content')\n})\n```\n\nWith three arguments (the third argument being a callback), the rest of the \nwork should be done within the supplied callback.\n\n```js\nconst http = require('http')\nconst protect = require('overload-protection')('http', protectCfg)\n\nhttp.createServer(function (req, res) {\n  protect(req, res, function () {\n    // when errorPropagationMode mode is false, will *only* \n    // be called if load shedding didn't occur\n    // (if it was true we'd need to check for an Error object as first arg)\n    res.end('content')\n  })\n})\n```\n\n## Installation\n\n```sh\nnpm install overload-protection --save\n```\n\n## Tests\n\n```sh\nnpm install\nnpm test\n```\n\n## Benchmark\n\nThe overhead of using `overload-protection` is minimal, run the benchmarks to conduct \ncomparative profiling of using `overload-protection` versus not using it for each supported framework.  \n\n```sh\nnpm run benchmarks\n```\n\n## API\n\n### require('overload-protection') => (framework, opts) => instance\n\nThe `framework` argument is non-optional. It's a string and may be one of:\n\n* express\n* koa\n* restify\n* http\n\nThe `opts` argument is optional, as are all properties.\n\nOptions (particularly thresholds) are quite sensitive and highly relevant on \na case by case basis. Possible options are as follows:\n\n#### production: process.env.NODE_ENV === 'production'\n\nThe `production` option determines whether the client receives an error message \ndetailing the surpassed threshold(s). (It may also be used in future for other such\ngood practices or performance trade-offs). \n\n#### clientRetrySecs: 1\n\nBy default, `overload-protection` will add a header to the 503 response\ncalled `Retry-After`. It's up to the client to honour this header, which\ninstructs the client on how many seconds to wait between retries. \nDefaults to 1 seconds.\n\n#### sampleInterval: 5\n\nIn order to establish whether a threshold has been crossed, the metrics \nare sampled at a regular interval. The interval defaults to 5 milliseconds.\n\n####  maxEventLoopDelay: 42\n\nSynchronous work causes the event loop to freeze, when this happens \nan interval timer (which is our sampler) will be delayed by the amount\nof time the event loop was stalled for while the thread processed synchronous \nwork. We can measure this with timestamp comparison. This option sets a threshold\nfor the maximum amount of stalling between intervals we'll accept before our\nservice begins responding with 503 codes to requests. Defaults to 42 milliseconds.\n\nWhen set to 0 this threshold will be disabled. \n\n#### maxHeapUsedBytes: 0\n\nDisabled by default (set to 0), this defines maximum V8 (Node's JavaScript engine) used heap size.\n\nIf the Used Heap size exceeds the threshold the server will begin return 503 error codes\nuntil it crosses back under the threshold. \n\nSee <https://www.dynatrace.com/blog/understanding-garbage-collection-and-hunting-memory-leaks-in-node-js>\nfor more info on Used Heap from a V8 context.\n\n#### maxRssBytes: 0\n\nDisabled by default (set to 0) maximum process Resident Set Size. If\nthe RSS exceeds the threshold the server will begin return 503 error codes\nuntil it crosses back under the threshold.\n\n#### errorPropagationMode: false\n\n**This is relevant to middleware integration only**\n\nBy default, `overload-protection` will handle and end the response, \nwithout calling any subsequent configured middleware. The point here \nis to avoid any further processing for an already (by definition) \nover loaded process.\n\nHowever, it could be argued, from a puritanical perspective, that middleware\nshould defer to the framework and that any HTTP code of 500 or above should \nbe generated by propagating an error through the framework. \n\nThis option prevents `overload-protection` from manually ended the response and\ninstead generates an `Error` object (with additional properties as per [`http-errors`](https://github.com/jshttp/http-errors) as used by Express and Koa)     \nand propagates it through the framework (either by throwing it in Koa, or passing through the `next` callback).\n\n#### logging: false\n\nThe `logging` option can be set to a string or a function. \n\nIf `logging` is set to a string, the string should indicate the desired log \nlevel for notifying that a 503 response was given. When `logging` is a string\na request bound Log4j-style logger is assumed. This means the `req` object (or the `ctx` object in the case of Koa) \nshould have a `log` object which contains methods corresponding to log levels. So if `logging`\nwas set to `warn` (`logging: 'warn'`) then `req.log.warn` is expected to be present\nand be a function. A number of logging libraries follow this pattern, such as \n[`bunyan-express`](http:/npm.im/bunyan-express) and all of the [`pino`](http://npm.im/pino) \nmiddleware loggers ([`express-pino-logger`](http://npm.im/express), [`koa-pino-logger`](http://npm.im/koa-pino-logger), \n[`restify-pino-logger`](http://npm.im/restify-pino-logger), [`pino-http`](http://npm.im/pino-http)).\n\nIf the application isn't using a request bound Log4j-style logger, the `logging` \noption can be set to a function which receives a log message. This function is \nthen responsible for writing the log. We could also simply set it to one of\nthe console methods, e.g. `logging: console.warn`. \n\nThis is primarily for usage when `errorPropagationMode` is `false`. If `errorPropagationMode` \nis set to `true`, we may want to instead log once the error has propagated to a handler.    \n\n#### logStatsOnReq: false\n\nSet `logStatsOnReq` to `true` log the profiled stats on every request. In order to use this option, the `logging` option must not be `false`. Bear in mind that using this option will\nadd extra pressure on the event loop in itself, so use with caution.\n\n### instance.overload\n\nThe returned instance (which in many cases is passed as middleware to `app.use`), \nhas an `overload` property. This begins as `false`. If any of the thresholds have \nbeen passed this will be set to `true`. Once all metrics are below their thresholds\nthis would become `false` again.\n\nThis allows for any heavy load detection required outside of a framework. \n\n### instance.eventLoopOverload\n\nThe returned instance (which in many cases is passed as middleware to `app.use`), \nhas an `eventLoopOverload` property. This begins as `false`. If the `maxEventLoopDelay`\nthreshold is passed this will be set to `true`. Once it's below the configured threshold\nthis would become `false` again.\n\nThis allows for any event loop delay detection necessary outside of a framework.\n\n### instance.heapUsedOverload\n\nThe returned instance (which in many cases is passed as middleware to `app.use`), \nhas a `heapUsedOverload` property. This begins as `false`. If the `maxHeapUsedBytes`\nthreshold is passed this will be set to `true`. Once it's below the configured threshold\nthis would become `false` again.\n\nThis allows for any heap used threshold detection necessary outside of a framework.\n\n### instance.rssOverload\n\nThe returned instance (which in many cases is passed as middleware to `app.use`), \nhas a `rssOverload` property. This begins as `false`. If the `maxRssBytes`\nthreshold is passed this will be set to `true`. Once it's below the configured threshold\nthis would become `false` again.\n\nThis allows for any heap used threshold detection necessary outside of a framework.\n\n### instance.eventLoopDelay\n\nThe delay in milliseconds (with additional decimal precision) since the last sample.\n\nIf `maxEventLoopDelay` is 0, the event loop is not measured, so `eventLoopDelay` will always\nbe 0 in that case.\n\n### instance.maxEventLoopDelay\n\nCorresponds to the `opts.maxEventLoopDelay` option.\n\n### instance.maxHeapUsedBytes\n\nCorresponds to the `opts.maxHeapUsedBytes` option.\n\n### instance.maxRssBytes\n\nCorresponds to the `opts.maxRssBytes` option.\n\n## Dependencies\n\n- [loopbench](https://github.com/mcollina/loopbench): Benchmark your event loop\n\n## Dev Dependencies\n\n- [autocannon](https://github.com/mcollina/autocannon): Fast HTTP benchmarking tool written in Node.js\n- [express](https://github.com/expressjs/express): Fast, unopinionated, minimalist web framework\n- [koa](https://github.com/koajs/koa): Koa web app framework\n- [koa-router](https://github.com/alexmingoia/koa-router): Router middleware for koa. Provides RESTful resource routing.\n- [pre-commit](https://github.com/observing/pre-commit): Automatically install pre-commit hooks for your npm modules.\n- [restify](https://github.com/restify/node-restify): REST framework\n- [standard](https://github.com/standard/standard): JavaScript Standard Style\n- [tap](https://github.com/tapjs/node-tap): A Test-Anything-Protocol library\n\n## License\n\nMIT\n\n## Acknowledgements\n\nKindly sponsored by [nearForm](http://nearform.com)","maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"},{"name":"davidmarkclements","email":"david.mark.clements@gmail.com"}],"time":{"modified":"2022-05-12T09:49:30.528Z","created":"2017-11-14T13:00:12.178Z","1.0.0":"2017-11-14T13:00:12.178Z","1.0.1":"2017-11-14T13:08:21.510Z","1.0.2":"2017-11-14T15:59:59.989Z","1.1.0":"2017-11-18T00:07:49.377Z","1.2.0":"2019-12-19T21:14:11.676Z","1.2.1":"2019-12-19T21:16:21.630Z","1.2.2":"2021-10-01T16:08:58.459Z","1.2.3":"2021-11-23T15:42:17.177Z"},"homepage":"https://github.com/davidmarkclements/overload-protection#readme","keywords":["load shedding","overload protection","production monitoring","503","Service Unavailable","Server Unavailable","HTTP 503","heavy load","load","protection","shedding","express","fastify","http","koa","restify"],"repository":{"type":"git","url":"git+https://github.com/davidmarkclements/overload-protection.git"},"author":{"name":"David Mark Clements","email":"huperekchuno@googlemail.com"},"bugs":{"url":"https://github.com/davidmarkclements/overload-protection/issues"},"license":"MIT","readmeFilename":"readme.md","users":{"matthiasg":true}}