Mercurial > kallithea
changeset 1341:1881b808a71d beta
small fixes for test crawler
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 15 May 2011 19:13:08 +0200 |
parents | cbdd583f1e58 |
children | 9dacacc5b7c2 |
files | rhodecode/tests/test_crawler.py |
diffstat | 1 files changed, 13 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/tests/test_crawler.py Sun May 15 18:29:33 2011 +0200 +++ b/rhodecode/tests/test_crawler.py Sun May 15 19:13:08 2011 +0200 @@ -88,13 +88,13 @@ size = len(f.read()) e = time.time() - s total_time += e - print 'visited %s\%s size:%s req:%s ms' % (full_uri, i, size, e) + print '%s visited %s\%s size:%s req:%s ms' % (cnt, full_uri, i, size, e) print 'total_time', total_time print 'average on req', total_time / float(cnt) -def test_files_walk(): +def test_files_walk(limit=100): print 'processing', jn(PROJECT_PATH, PROJECT) total_time = 0 @@ -118,7 +118,12 @@ except vcs.exception.RepositoryError, e: pass + cnt = 0 for f in paths_: + cnt += 1 + if limit and limit == cnt: + break + file_path = '/'.join((PROJECT, 'files', 'tip', f)) full_uri = (BASE_URI % file_path) @@ -127,13 +132,15 @@ size = len(f.read()) e = time.time() - s total_time += e - print 'visited %s size:%s req:%s ms' % (full_uri, size, e) + print '%s visited %s size:%s req:%s ms' % (cnt, full_uri, size, e) print 'total_time', total_time - print 'average on req', total_time / float(len(repo)) + print 'average on req', total_time / float(cnt) + -test_files_walk() test_changelog_walk(40) +time.sleep(2) test_changeset_walk(limit=100) - +time.sleep(2) +test_files_walk(100)