Commit 6a7c2667 authored by Bryton Lacquement's avatar Bryton Lacquement 🚪

wip

parent ff5db8a0
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
# #
############################################################################## ##############################################################################
from __future__ import print_function
import argparse import argparse
import os import os
import sys import sys
...@@ -264,7 +265,7 @@ class PerformanceTester(object): ...@@ -264,7 +265,7 @@ class PerformanceTester(object):
error_message = exit_msg_queue.get() error_message = exit_msg_queue.get()
except KeyboardInterrupt, e: except KeyboardInterrupt, e:
print >>sys.stderr, "\nInterrupted by user, stopping gracefully..." print("\nInterrupted by user, stopping gracefully...", file=sys.stderr)
exit_status = 2 exit_status = 2
# An IOError may be raised when receiving a SIGINT which interrupts the # An IOError may be raised when receiving a SIGINT which interrupts the
...@@ -337,7 +338,7 @@ class PerformanceTester(object): ...@@ -337,7 +338,7 @@ class PerformanceTester(object):
def main(): def main():
error_message_set, exit_status = PerformanceTester().run() error_message_set, exit_status = PerformanceTester().run()
for error_message in error_message_set: for error_message in error_message_set:
print >>sys.stderr, "ERROR: %s" % error_message print("ERROR: %s" % error_message, file=sys.stderr)
sys.exit(exit_status) sys.exit(exit_status)
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
# #
############################################################################## ##############################################################################
from __future__ import print_function
import argparse import argparse
import re import re
...@@ -537,7 +538,7 @@ def generateReport(): ...@@ -537,7 +538,7 @@ def generateReport():
for filename in filename_iter: for filename in filename_iter:
# There may be no results at all in case of errors # There may be no results at all in case of errors
if not os.stat(filename).st_size: if not os.stat(filename).st_size:
print >>sys.stderr, "Ignoring empty file %s" % filename print("Ignoring empty file %s" % filename, file=sys.stderr)
continue continue
report_dict = per_nb_users_report_dict.setdefault( report_dict = per_nb_users_report_dict.setdefault(
...@@ -546,8 +547,8 @@ def generateReport(): ...@@ -546,8 +547,8 @@ def generateReport():
report_dict['filename'].append(filename) report_dict['filename'].append(filename)
if not per_nb_users_report_dict: if not per_nb_users_report_dict:
print >>sys.stderr, "ERROR: No result file found, perhaps "\ print("ERROR: No result file found, perhaps "\
"``--filename-prefix'' should be specified?" "``--filename-prefix'' should be specified?", file=sys.stderr)
sys.exit(1) sys.exit(1)
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
# #
############################################################################## ##############################################################################
from __future__ import print_function
from .result import CSVBenchmarkResult, NothingFlushedException from .result import CSVBenchmarkResult, NothingFlushedException
class CSVScalabilityBenchmarkResult(CSVBenchmarkResult): class CSVScalabilityBenchmarkResult(CSVBenchmarkResult):
...@@ -60,7 +61,7 @@ class ScalabilityTester(PerformanceTester): ...@@ -60,7 +61,7 @@ class ScalabilityTester(PerformanceTester):
urllib.urlencode({'error_message_set': '|'.join(error_message_set)})).close() urllib.urlencode({'error_message_set': '|'.join(error_message_set)})).close()
except: except:
print >>sys.stderr, "ERROR: %s" % Formatter().formatException(sys.exc_info()) print("ERROR: %s" % Formatter().formatException(sys.exc_info()), file=sys.stderr)
def getResultClass(self): def getResultClass(self):
if not self._argument_namespace.erp5_publish_url: if not self._argument_namespace.erp5_publish_url:
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
# #
# TODO: There must be a better way than the code below to do that though... # TODO: There must be a better way than the code below to do that though...
from __future__ import print_function
import sys import sys
from erp5.util.testbrowser.browser import Browser from erp5.util.testbrowser.browser import Browser
...@@ -19,9 +20,9 @@ try: ...@@ -19,9 +20,9 @@ try:
user_nbr = int(user_nbr) user_nbr = int(user_nbr)
except ValueError: except ValueError:
print >>sys.stderr, "ERROR: Missing arguments: %s URL USERNAME " \ print("ERROR: Missing arguments: %s URL USERNAME " \
"PASSWORD NUMBER_OF_USERS NEW_USERNAME_PREFIX NEW_USERS_PASSWORD" % \ "PASSWORD NUMBER_OF_USERS NEW_USERNAME_PREFIX NEW_USERS_PASSWORD" % \
sys.argv[0] sys.argv[0], file=sys.stderr)
sys.exit(1) sys.exit(1)
......
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import print_function
from erp5.util.testbrowser.browser import Browser from erp5.util.testbrowser.browser import Browser
ITERATION = 20 ITERATION = 20
...@@ -89,4 +90,4 @@ if __name__ == '__main__': ...@@ -89,4 +90,4 @@ if __name__ == '__main__':
counter += 1 counter += 1
for title, time_list in result_dict.iteritems(): for title, time_list in result_dict.iteritems():
print "%s: %.4fs" % (title, float(sum(time_list)) / ITERATION) print("%s: %.4fs" % (title, float(sum(time_list)) / ITERATION))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment