MCPcopy Index your code
hub / github.com/nodejs/node / do_run

Function do_run

deps/v8/tools/callstats.py:263–300  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

261 return [{'url': site, 'timeout': args.timeout} for site in args.sites]
262
263def do_run(args):
264 sites = read_sites(args)
265 replay_server = start_replay_server(args, sites) if args.replay_wpr else None
266 # Disambiguate domains, if needed.
267 L = []
268 domains = {}
269 for item in sites:
270 site = item['url']
271 domain = None
272 if args.domain:
273 domain = args.domain
274 elif 'domain' in item:
275 domain = item['domain']
276 else:
277 m = re.match(r'^(https?://)?([^/]+)(/.*)?$', site)
278 if not m:
279 args.error("Invalid URL {}.".format(site))
280 continue
281 domain = m.group(2)
282 entry = [site, domain, None, item['timeout']]
283 if domain not in domains:
284 domains[domain] = entry
285 else:
286 if not isinstance(domains[domain], int):
287 domains[domain][2] = 1
288 domains[domain] = 1
289 domains[domain] += 1
290 entry[2] = domains[domain]
291 L.append(entry)
292 try:
293 # Run them.
294 for site, domain, count, timeout in L:
295 if count is not None: domain = "{}%{}".format(domain, count)
296 print((site, domain, timeout))
297 run_site(site, domain, args, timeout)
298 finally:
299 if replay_server:
300 stop_replay_server(replay_server)
301
302
303def do_run_replay_server(args):

Callers

nothing calls this directly

Calls 9

read_sitesFunction · 0.85
start_replay_serverFunction · 0.85
run_siteFunction · 0.85
stop_replay_serverFunction · 0.85
printFunction · 0.70
matchMethod · 0.65
formatMethod · 0.65
errorMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected