#!/usr/bin/tclsh # # Run this script from within any open Fossil checkout. Example: # # tclsh many-www.tcl | tee out.txt # # About 10,000 different web page requests will be made. Each is timed # and the time shown on output. Use this script to search for segfault problems # or to look for pages that need optimization. # proc run_query {url} { set fd [open q.txt w] puts $fd "GET $url HTTP/1.0\r\n\r" close $fd return [exec fossil test-http 1000000} { set x [string range $x 0 1000000] } set k 0 while {[regexp {<[aA] .*?href="(/[a-z].*?)".*?>(.*)$} $x all url tail]} { # if {$npending>2*($limit - $i)} break incr k if {$k>100} break set u2 [string map {< < > > " \" & &} $url] if {![info exists seen($u2)]} { set next($u2) 1 set seen($u2) 1 } set x $tail } }