# HG changeset patch # User Marcin Kuzminski # Date 1305479588 -7200 # Node ID 1881b808a71dd155ddd2fbd69d4f68639881b433 # Parent cbdd583f1e5864c3ecd5fb55e3b216803e3f5e00 small fixes for test crawler diff -r cbdd583f1e58 -r 1881b808a71d rhodecode/tests/test_crawler.py --- 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)