Exemple #1
0
    def test_percentile_rounded_down(self):
        s1 = StatsEntry(self.stats, "rounding down!", "GET")
        s1.log(122, 0)  # (rounded 120) min
        actual_percentile = s1.percentile().split()

        self.assertEqual(actual_percentile, ["GET", "rounding", "down!"] +
                         ["120"] * len(PERCENTILES_TO_REPORT) + ["1"])
Exemple #2
0
    def test_percentile_rounded_down(self):
        s1 = StatsEntry(self.stats, "rounding down!", "GET")
        s1.log(122, 0)  # (rounded 120) min
        actual_percentile = s1.percentile().split()

        self.assertEqual(actual_percentile, ['GET', 'rounding', 'down!'] +
                         ['120'] * len(PERCENTILES_TO_REPORT) + ['1'])
Exemple #3
0
 def test_custom_percentile_list(self):
     s = StatsEntry(self.stats, "custom_percentiles", "GET")
     custom_percentile_list = [0.50, 0.90, 0.95, 0.99]
     locust.stats.PERCENTILES_TO_REPORT = custom_percentile_list
     s.log(150, 0)
     actual_percentile = s.percentile().split()
     self.assertEqual(actual_percentile, ['GET', 'custom_percentiles'] + ['150'] * len(custom_percentile_list) + ['1'])
Exemple #4
0
 def test_percentile_rounded_up(self):
     s2 = StatsEntry(self.stats, "rounding up!", "GET")
     s2.log(127, 0)  # (rounded 130) min
     actual_percentile = s2.percentile()
     self.assertEqual(
         actual_percentile,
         " GET rounding up!                                                    1    130    130    130    130    130    130    130    130    130    130    130"
     )
Exemple #5
0
 def test_percentile_rounded_down(self):
     s1 = StatsEntry(self.stats, "rounding down!", "GET")
     s1.log(122, 0)  # (rounded 120) min
     actual_percentile = s1.percentile()
     self.assertEqual(
         actual_percentile,
         " GET rounding down!                                                  1    120    120    120    120    120    120    120    120    120    120    120"
     )
Exemple #6
0
 def test_percentile_rounded_up(self):
     s2 = StatsEntry(self.stats, "rounding up!", "GET")
     s2.log(127, 0)    # (rounded 130) min
     actual_percentile = s2.percentile()
     assert actual_percentile == " GET rounding up!                                                    1    130    130    130    130    130    130    130    130    130"
Exemple #7
0
 def test_percentile_rounded_down(self):
     s1 = StatsEntry(self.stats, "rounding down!", "GET")
     s1.log(122, 0)    # (rounded 120) min
     actual_percentile = s1.percentile()
     assert actual_percentile == " GET rounding down!                                                  1    120    120    120    120    120    120    120    120    120"
Exemple #8
0
 def test_percentile_rounded_up(self):
     s2 = StatsEntry(self.stats, "rounding up!", "GET")
     s2.log(127, 0)  # (rounded 130) min
     actual_percentile = s2.percentile().split()
     self.assertEqual(actual_percentile, ["GET", "rounding", "up!"] +
                      ["130"] * len(PERCENTILES_TO_REPORT) + ["1"])
Exemple #9
0
 def test_percentile_rounded_up(self):
     s2 = StatsEntry(self.stats, "rounding up!", "GET")
     s2.log(127, 0)  # (rounded 130) min
     actual_percentile = s2.percentile().split()
     self.assertEqual(actual_percentile, ['GET', 'rounding', 'up!', '1'] +
                      ['130'] * len(PERCENTILES_TO_REPORT))