Commit 6a6ddcab authored by Arnaud Fontaine's avatar Arnaud Fontaine

Move the code specify to ScalabilityTester to its proper class.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@45928 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2de6a31b
...@@ -28,31 +28,47 @@ ...@@ -28,31 +28,47 @@
# #
############################################################################## ##############################################################################
from slapos.tool.nosqltester import NoSQLTester from benchmark import CSVBenchmarkResult
class CSVScalabilityBenchmarkResult(CSVBenchmarkResult):
def flush(self):
super(CSVScalabilityBenchmarkResult, self).flush()
self._argument_namespace.notify_method(self._result_filename,
self._result.tell())
from erp5.utils.benchmark.performance_tester import PerformanceTester from erp5.utils.benchmark.performance_tester import PerformanceTester
class ScalabilityTester(NoSQLTester): class ScalabilityTester(PerformanceTester):
def preRun(self):
pass
def getResultClass(self):
if not self._argument_namespace.erp5_publish_url:
return CSVScalabilityBenchmarkResult
return super(ScalabilityTester, self).getResultClass()
from slapos.tool.nosqltester import NoSQLTester
class RunScalabilityTester(NoSQLTester):
def __init__(self): def __init__(self):
super(ScalabilityTester, self).__init__() super(RunScalabilityTester, self).__init__()
def _add_parser_arguments(self, parser): def _add_parser_arguments(self, parser):
super(ScalabilityTester, self)._add_parser_arguments(parser) super(RunScalabilityTester, self)._add_parser_arguments(parser)
PerformanceTester._add_parser_arguments(parser) ScalabilityTester._add_parser_arguments(parser)
def _parse_arguments(self, parser): def _parse_arguments(self, parser):
namespace = super(ScalabilityTester, self)._parse_arguments(parser) namespace = super(RunScalabilityTester, self)._parse_arguments(parser)
PerformanceTester._check_parsed_arguments(namespace) ScalabilityTester._check_parsed_arguments(namespace)
namespace.notify_method = self.send_result_availability_notification
return namespace return namespace
def run_tester(self): def run_tester(self):
performance_tester = PerformanceTester( ScalabilityTester(self.argument_namespace).run()
self.send_result_availability_notification,
self.argument_namespace)
performance_tester.run()
def main(): def main():
ScalabilityTester().run() RunScalabilityTester().run()
if __name__ == '__main__': if __name__ == '__main__':
main() main()
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