profiling

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@110 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2000-06-11 20:26:08 +00:00
parent 20d9fa38d9
commit 5f54270a5a
6 changed files with 38 additions and 25 deletions

17
INSTALL
View file

@ -1,24 +1,28 @@
LinkChecker installation
==========================
Requirements:
Requirements
------------
You need Python >= 1.5.2 from http://www.python.org/
Optionally packages:
Distutils >= 0.8.3 from http://www.python.org/sigs/distutils-sig/
Optionally packages
-------------------
Distutils >= 0.9 from http://www.python.org/sigs/distutils-sig/
OpenSSL from http://www.openssl.org/
You will need Perl for Win32 (available from
http://www.activestate.com/ActivePerl) if you want to install OpenSSL
on Windows!
Install with Distutils:
Install with Distutils
----------------------
The Distutils package has a lot of install options to tweak and ease
your installation.
To install LinkChecker run "python setup.py install".
Debian users can build the .deb package with "debian/rules binary".
Install without Distutils:
Install without Distutils
-------------------------
Execute "python install.py" to install LinkChecker in the distribution
directory.
To use HTTPS, compile the Pyhton module ssl.c, for example with
@ -28,7 +32,8 @@ Put the distribution directory in your path to execute the linkchecker
script from everywhere.
Running LinkChecker:
Running LinkChecker
-------------------
Type "linkchecker" followed by your URLs you want to check.
Type "linkchecker -h" for help.

View file

@ -50,8 +50,9 @@ dist:
files:
./$(PACKAGE) $(LCOPTS) $(PROXY) -i$(HOST) http://$(HOST)/~calvin/
homepage:
upload:
scp debian/changelog shell1.sourceforge.net:/home/groups/linkchecker/htdocs/changes.txt
ncftpput download.sourceforge.net /incoming $(ALLPACKAGES)
test:
rm -f test/*.result

3
README
View file

@ -102,5 +102,6 @@ o Wash-O-matic. LinkChecker has a secret option which washes all your
dirty clothes in a matter of seconds.
o Y2K-Compatible(tm) guarantee. The fact that you can read this text
in the Millenium age is proof enough!
o Self destruction option (also called kamikaze option). Banzaaaiiii!
o Self destruction option (also called kamikaze option). Hit your fists
several times on your keyboard. Banzaaaiiii!
o There is no spoon. Wake up already!

View file

@ -5,10 +5,11 @@ t = Template.Template("linkcheck/__init__.py.tmpl")
f = open("linkcheck/__init__.py","w")
f.write(t.fill_in({"install_data": distpath}))
f.close()
t = Template.Template("linkchecker.tmpl")
f = open("linkchecker","w")
f.write(t.fill_in({"syspath": "sys.path.insert(0, '"+distpath+"')"}))
f.close()
for name in ['linkchecker','test/profiletest.py']:
t = Template.Template(name+".tmpl")
f = open(name,"w")
f.write(t.fill_in({"syspath": "sys.path.insert(0, '"+distpath+"')"}))
f.close()
os.chmod("linkchecker", 0755)
t = Template.Template("linkchecker.bat.tmpl")
f = open("linkchecker.bat","w")

View file

@ -1,13 +0,0 @@
#!/usr/bin/env python
# profiling test
import sys
sys.path.append("/home/calvin/projects/linkchecker/")
import linkcheck,re,profile,pstats
url="http://treasure.calvinsplayground.de/~calvin/"
config = linkcheck.Config.Configuration()
config["verbose"] = 1
config.appendUrl(linkcheck.UrlData.GetUrlDataFrom(url, 0))
profile.run("linkcheck.checkUrls(config)", "test.prof")
p = pstats.Stats("test.prof")
p.strip_dirs().sort_stats("time").print_stats(10)

18
test/profiletest.py.tmpl Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env python
# profiling test
import sys,re,profile,pstats
# add the path to linkcheck module if you do not install with distutils
$syspath
import linkcheck
url='http://www.yahoo.de/'
config = linkcheck.Config.Configuration()
config['recursionlevel'] = 5
config['anchors'] = 1
config['internlinks'].append(re.compile(r"^(ftp|https?)://www\.yahoo\.de/"))
# avoid checking of local files (security!)
config["externlinks"].append((re.compile("^file:"), 1))
config.appendUrl(linkcheck.UrlData.GetUrlDataFrom(url, 0))
profile.run("linkcheck.checkUrls(config)", "test.prof")
p = pstats.Stats("test.prof")
p.strip_dirs().sort_stats("time").print_stats(20)