MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / generateStringPool

Function generateStringPool

apps/web/src/scripts/usage/benchmark-insert-usage.ts:217–230  ·  view source on GitHub ↗
(
  count: number,
  avgLen: number,
  minLen: number,
  maxLen: number,
  totalRows: number
)

Source from the content-addressed store, hash-verified

215 for (let i = 0; i < scaledCount; i++) {
216 pool.push(randomString(avgLen, minLen, maxLen));
217 }
218 return pool;
219}
220
221async function truncateTables() {
222 console.log('Truncating tables and cleaning up benchmark users...');
223 await db.execute(sql`TRUNCATE TABLE microdollar_usage_metadata CASCADE`);
224 await db.execute(sql`TRUNCATE TABLE microdollar_usage CASCADE`);
225 await db.execute(sql`TRUNCATE TABLE http_user_agent CASCADE`);
226 await db.execute(sql`TRUNCATE TABLE http_ip CASCADE`);
227 await db.execute(sql`TRUNCATE TABLE vercel_ip_country CASCADE`);
228 await db.execute(sql`TRUNCATE TABLE vercel_ip_city CASCADE`);
229 await db.execute(sql`TRUNCATE TABLE ja4_digest CASCADE`);
230 await db.execute(
231 sql`DELETE FROM kilocode_users WHERE google_user_email LIKE 'benchmark-%@test.local'`
232 );
233 console.log('Tables truncated and benchmark users deleted.');

Callers 1

runBenchmarkFunction · 0.85

Calls 3

scaleUniqueCountFunction · 0.85
randomStringFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected