def test_locust_slave_results_errors(self): obj = SlavesReader(RESOURCES_DIR + "locust/locust-slaves2.ldjson", 2, ROOT_LOGGER) points = [x for x in obj.datapoints(True)] self.assertEquals(60, len(points)) for point in points: self.assertEquals(len(point[DataPoint.CURRENT][''][KPISet.ERRORS]), 1) self.assertGreaterEqual(point[DataPoint.CURRENT][''][KPISet.FAILURES], 70)
def test_locust_slave_results(self): obj = SlavesReader(RESOURCES_DIR + "locust/locust-slaves.ldjson", 2, ROOT_LOGGER) points = [x for x in obj.datapoints(True)] self.assertEquals(107, len(points)) for point in points: self.assertGreater(point[DataPoint.CURRENT][''][KPISet.AVG_RESP_TIME], 0) self.assertGreater(point[DataPoint.CURRENT][''][KPISet.BYTE_COUNT], 0)
def test_locust_slave_results(self): if six.PY3: logging.warning("No locust available for python 3") obj = SlavesReader(__dir__() + "/../locust/locust-slaves.ldjson", 2, logging.getLogger("")) points = [x for x in obj.datapoints(True)] self.assertEquals(107, len(points)) for point in points: self.assertGreater(point[DataPoint.CURRENT][''][KPISet.AVG_RESP_TIME], 0)
def test_locust_slave_results_errors(self): obj = SlavesReader(RESOURCES_DIR + "locust/locust-slaves2.ldjson", 2, ROOT_LOGGER) points = [x for x in obj.datapoints(True)] self.assertEquals(60, len(points)) for point in points: self.assertEquals(len(point[DataPoint.CURRENT][''][KPISet.ERRORS]), 1) self.assertGreaterEqual( point[DataPoint.CURRENT][''][KPISet.FAILURES], 70)
def test_locust_slave_results(self): obj = SlavesReader(RESOURCES_DIR + "locust/locust-slaves.ldjson", 2, ROOT_LOGGER) points = [x for x in obj.datapoints(True)] self.assertEquals(107, len(points)) for point in points: self.assertGreater( point[DataPoint.CURRENT][''][KPISet.AVG_RESP_TIME], 0) self.assertGreater(point[DataPoint.CURRENT][''][KPISet.BYTE_COUNT], 0)
def test_locust_slave_results_errors(self): if six.PY3: logging.warning("No locust available for python 3") obj = SlavesReader(RESOURCES_DIR + "locust/locust-slaves2.ldjson", 2, logging.getLogger("")) points = [x for x in obj.datapoints(True)] self.assertEquals(60, len(points)) for point in points: self.assertEquals(len(point[DataPoint.CURRENT][''][KPISet.ERRORS]), 1) self.assertGreaterEqual(point[DataPoint.CURRENT][''][KPISet.FAILURES], 70)
def test_slave_aggregation(self): self.configure({ "execution": { "scenario": { "script": RESOURCES_DIR + "locust/simple.py" } } }) self.obj.prepare() self.obj.reader = SlavesReader( RESOURCES_DIR + "locust/locust-slaves.ldjson", 2, ROOT_LOGGER) self.obj.engine.aggregator = ConsolidatingAggregator() self.obj.engine.aggregator.add_underling(self.obj.reader) self.assertEqual( 1, len(list(self.obj.engine.aggregator.datapoints(final_pass=True))))
def test_locust_delayed_slave(self): obj = SlavesReader(RESOURCES_DIR + "locust/locust-slaves-none.ldjson", 2, ROOT_LOGGER) points = [x for x in obj.datapoints(True)] self.assertEquals(0, len(points))