##// END OF EJS Templates
small fixes for test crawler
marcink -
r1341:1881b808 beta
parent child Browse files
Show More
@@ -88,13 +88,13 b' def test_changeset_walk(limit=None):'
88 size = len(f.read())
88 size = len(f.read())
89 e = time.time() - s
89 e = time.time() - s
90 total_time += e
90 total_time += e
91 print 'visited %s\%s size:%s req:%s ms' % (full_uri, i, size, e)
91 print '%s visited %s\%s size:%s req:%s ms' % (cnt, full_uri, i, size, e)
92
92
93 print 'total_time', total_time
93 print 'total_time', total_time
94 print 'average on req', total_time / float(cnt)
94 print 'average on req', total_time / float(cnt)
95
95
96
96
97 def test_files_walk():
97 def test_files_walk(limit=100):
98 print 'processing', jn(PROJECT_PATH, PROJECT)
98 print 'processing', jn(PROJECT_PATH, PROJECT)
99 total_time = 0
99 total_time = 0
100
100
@@ -118,7 +118,12 b' def test_files_walk():'
118 except vcs.exception.RepositoryError, e:
118 except vcs.exception.RepositoryError, e:
119 pass
119 pass
120
120
121 cnt = 0
121 for f in paths_:
122 for f in paths_:
123 cnt += 1
124 if limit and limit == cnt:
125 break
126
122 file_path = '/'.join((PROJECT, 'files', 'tip', f))
127 file_path = '/'.join((PROJECT, 'files', 'tip', f))
123
128
124 full_uri = (BASE_URI % file_path)
129 full_uri = (BASE_URI % file_path)
@@ -127,13 +132,15 b' def test_files_walk():'
127 size = len(f.read())
132 size = len(f.read())
128 e = time.time() - s
133 e = time.time() - s
129 total_time += e
134 total_time += e
130 print 'visited %s size:%s req:%s ms' % (full_uri, size, e)
135 print '%s visited %s size:%s req:%s ms' % (cnt, full_uri, size, e)
131
136
132 print 'total_time', total_time
137 print 'total_time', total_time
133 print 'average on req', total_time / float(len(repo))
138 print 'average on req', total_time / float(cnt)
139
134
140
135
141
136 test_files_walk()
137 test_changelog_walk(40)
142 test_changelog_walk(40)
143 time.sleep(2)
138 test_changeset_walk(limit=100)
144 test_changeset_walk(limit=100)
139
145 time.sleep(2)
146 test_files_walk(100)
General Comments 0
You need to be logged in to leave comments. Login now