From 96426d01c1c0d3d3b766afabf9892d93c9002808 Mon Sep 17 00:00:00 2001 From: desu-bot Date: Sun, 27 Apr 2025 22:31:46 +0000 Subject: [PATCH] chore: update public repo --- scripts/misc/hits-nakrutka.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/misc/hits-nakrutka.ts diff --git a/scripts/misc/hits-nakrutka.ts b/scripts/misc/hits-nakrutka.ts new file mode 100644 index 0000000..3a19643 --- /dev/null +++ b/scripts/misc/hits-nakrutka.ts @@ -0,0 +1,17 @@ +import { asyncPool } from '@fuman/utils' +import { argv, question } from 'zx' +import { counterIter } from '../../utils/counter.ts' + +const url = argv[1] || await question('url > ') +const count = argv[2] || await question('count > ') + +const counter = counterIter(0, count) + +await asyncPool(counter.iter, async (i) => { + if (i % 100 === 0) { + console.log('currently at %d', i) + } + await fetch(url) +}) + +console.log('nakrutka done')