MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / simultaneousRequests

Function simultaneousRequests

apps/api/scripts/mock.ts:263–486  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

261}
262
263async function simultaneousRequests() {
264 await getRedisCache().flushdb();
265 await new Promise((resolve) => setTimeout(resolve, 1000));
266 const sessions: {
267 ip: string;
268 referrer: string;
269 userAgent: string;
270 track: Record<string, string>[];
271 }[] = [
272 {
273 ip: '122.168.1.101',
274 referrer: 'https://www.google.com',
275 userAgent:
276 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
277 track: [
278 { name: 'screen_view', path: '/home', parallel: '1' },
279 { name: 'button_click', element: 'signup', parallel: '1' },
280 { name: 'article_viewed', articleId: '123', parallel: '1' },
281 { name: 'screen_view', path: '/pricing', parallel: '1' },
282 { name: 'screen_view', path: '/blog', parallel: '1' },
283 ],
284 },
285 {
286 ip: '192.168.1.101',
287 referrer: 'https://www.bing.com',
288 userAgent:
289 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
290 track: [{ name: 'screen_view', path: '/landing' }],
291 },
292 {
293 ip: '192.168.1.102',
294 referrer: 'https://www.google.com',
295 userAgent:
296 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15',
297 track: [{ name: 'screen_view', path: '/about' }],
298 },
299 {
300 ip: '192.168.1.103',
301 referrer: '',
302 userAgent:
303 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Mobile/15E148 Safari/604.1',
304 track: [
305 { name: 'screen_view', path: '/home' },
306 { name: 'form_submit', form: 'contact' },
307 ],
308 },
309 {
310 ip: '192.168.1.104',
311 referrer: '',
312 userAgent:
313 'Mozilla/5.0 (Linux; Android 11; SM-G991B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.120 Mobile Safari/537.36',
314 track: [{ name: 'screen_view', path: '/products' }],
315 },
316 {
317 ip: '203.0.113.101',
318 referrer: 'https://www.facebook.com',
319 userAgent:
320 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0',

Callers 1

mainFunction · 0.85

Calls 7

getRedisCacheFunction · 0.90
trackitFunction · 0.85
parseMethod · 0.80
pushMethod · 0.45
logMethod · 0.45
mapMethod · 0.45
stringifyMethod · 0.45

Tested by

no test coverage detected