From ee13f84b478e3774aedbededc1144c0a46153587 Mon Sep 17 00:00:00 2001
From: Thomas Gambier <thomas.gambier@gmail.com>
Date: Fri, 22 Apr 2022 10:02:43 +0200
Subject: [PATCH] erp5.util: remove unused code

---
 erp5/util/benchmark/scalability_tester.py | 95 -----------------------
 setup.py                                  |  3 -
 2 files changed, 98 deletions(-)
 delete mode 100644 erp5/util/benchmark/scalability_tester.py

diff --git a/erp5/util/benchmark/scalability_tester.py b/erp5/util/benchmark/scalability_tester.py
deleted file mode 100644
index 0e4ae755b6..0000000000
--- a/erp5/util/benchmark/scalability_tester.py
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/usr/bin/env python
-
-##############################################################################
-#
-# Copyright (c) 2011 Nexedi SA and Contributors. All Rights Reserved.
-#                    Arnaud Fontaine <arnaud.fontaine@nexedi.com>
-#
-# WARNING: This program as such is intended to be used by professional
-# programmers who take the whole responsability of assessing all potential
-# consequences resulting from its eventual inadequacies and bugs
-# End users who are looking for a ready-to-use solution with commercial
-# garantees and support are strongly adviced to contract a Free Software
-# Service Company
-#
-# This program is Free Software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-#
-##############################################################################
-
-from __future__ import print_function
-from .result import CSVBenchmarkResult, NothingFlushedException
-
-class CSVScalabilityBenchmarkResult(CSVBenchmarkResult):
-  def flush(self, partial=True):
-    try:
-      super(CSVScalabilityBenchmarkResult, self).flush(partial)
-    except NothingFlushedException:
-      pass
-    else:
-      self._argument_namespace.notify_method(self._result_filename,
-                                             self._result_file.tell(),
-                                             partial=partial)
-
-from .performance_tester import PerformanceTester
-
-class ScalabilityTester(PerformanceTester):
-  def preRun(self, *args, **kwargs):
-    pass
-
-  def postRun(self, error_message_set):
-    from logging import Formatter
-    import sys
-    from six.moves.urllib.request import urlencode
-    from six.moves.urllib.parse import urlopen
-
-    try:
-      urlopen("http://[%s]:%d/report" % \
-                        (self._argument_namespace.manager_address,
-                         self._argument_namespace.manager_port),
-                      urlencode({'error_message_set': '|'.join(error_message_set)})).close()
-
-    except Exception:
-      print("ERROR: %s" % Formatter().formatException(sys.exc_info()), file=sys.stderr)
-
-  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):
-    super(RunScalabilityTester, self).__init__()
-
-  def _add_parser_arguments(self, parser):
-    super(RunScalabilityTester, self)._add_parser_arguments(parser)
-    ScalabilityTester._add_parser_arguments(parser)
-
-  def _parse_arguments(self, parser):
-    namespace = super(RunScalabilityTester, self)._parse_arguments(parser)
-    ScalabilityTester._check_parsed_arguments(namespace)
-    namespace.notify_method = self.send_result_availability_notification
-    return namespace
-
-  def run_tester(self):
-    ScalabilityTester(self.argument_namespace).run()
-
-def main():
-  RunScalabilityTester().run()
-
-if __name__ == '__main__':
-  main()
diff --git a/setup.py b/setup.py
index 98ae95356c..0a80a34b94 100644
--- a/setup.py
+++ b/setup.py
@@ -56,7 +56,6 @@ setup(name=name,
         'testbrowser': ['zope.testbrowser >= 5.0.0', 'z3c.etestbrowser'],
         'benchmark': benchmark_install_require_list,
         'benchmark-report': [name+'[benchmark]', 'matplotlib', 'numpy'],
-        'scalability_tester': [name+'[benchmark]', 'slapos.tool.nosqltester'],
         'zodbanalyse': ['ZODB'],
       },
       zip_safe=True,
@@ -67,8 +66,6 @@ setup(name=name,
           'testnode = erp5.util.testnode:main [testnode]',
           'performance_tester_erp5 = '\
             'erp5.util.benchmark.performance_tester:main [benchmark]',
-          'scalability_tester_erp5 = '\
-            'erp5.util.benchmark.scalability_tester:main [scalability_tester]',
           'runScalabilityTestSuite = '\
             'erp5.util.scalability.runScalabilityTestSuite:main',
           'requestUrl = '\
-- 
2.30.9