Exemple #1
0
 def test_percentile(self):
     ''' Garner confidence that we're not biases by rare events '''
     samples = [
         (1234567893, 1, 1440),
         (1234567894, 1, 1440),
         (1234567895, 1, 1440),
         (1234567896, 1, 1440),
         (1234567196, 100, 1440),
     ]
     self.assertEqual(
         raw_analyze._compute_bottleneck_capacity(samples, 1440), 1440)
 def test_percentile(self):
     ''' Garner confidence that we're not biases by rare events '''
     samples = [
                (1234567893, 1, 1440),
                (1234567894, 1, 1440),
                (1234567895, 1, 1440),
                (1234567896, 1, 1440),
                (1234567196, 100, 1440),
               ]
     self.assertEqual(raw_analyze._compute_bottleneck_capacity(
       samples, 1440), 1440)
Exemple #3
0
 def test_functionality(self):
     ''' Make sure it produces a reasonable result for typical input '''
     samples = [
         (0.050997, 0.000000, 1440),
         (0.052390, 0.001393, 1440),
         (0.142646, 0.090256, 1440),
         (0.145038, 0.002392, 1440),
         (0.147341, 0.002303, 1440),
         (0.196586, 0.049245, 1440),
         (0.196947, 0.000361, 1440),
         (0.199582, 0.002635, 1440),
         (0.245488, 0.045906, 1440),
         (0.247373, 0.001885, 1440),
     ]
     capacity = raw_analyze._compute_bottleneck_capacity(samples, 1440)
     self.assertEqual(capacity, 602006.68896321068)
 def test_functionality(self):
     ''' Make sure it produces a reasonable result for typical input '''
     samples = [
                (0.050997, 0.000000, 1440),
                (0.052390, 0.001393, 1440),
                (0.142646, 0.090256, 1440),
                (0.145038, 0.002392, 1440),
                (0.147341, 0.002303, 1440),
                (0.196586, 0.049245, 1440),
                (0.196947, 0.000361, 1440),
                (0.199582, 0.002635, 1440),
                (0.245488, 0.045906, 1440),
                (0.247373, 0.001885, 1440),
               ]
     capacity = raw_analyze._compute_bottleneck_capacity(samples, 1440)
     self.assertEqual(capacity, 602006.68896321068)
Exemple #5
0
 def test_float_division(self):
     ''' Make sure it deals gracefully with zero interval '''
     self.assertEqual(
         raw_analyze._compute_bottleneck_capacity([(1234567894, 0, 1380)],
                                                  1440), None)
Exemple #6
0
 def test_ignore_small_mss(self):
     ''' Make sure we ignore samples <= than 1/2 MSS '''
     self.assertEqual(
         raw_analyze._compute_bottleneck_capacity([(1234567894, 3, 720)],
                                                  1440), None)
Exemple #7
0
 def test_ignore_big_mss(self):
     ''' Make sure we ignore samples bigger than one MSS '''
     self.assertEqual(
         raw_analyze._compute_bottleneck_capacity([(1234567894, 3, 1441)],
                                                  1440), None)
Exemple #8
0
 def test_empty(self):
     ''' Make sure it works for empty input '''
     self.assertEqual(raw_analyze._compute_bottleneck_capacity([], 1440),
                      None)
 def test_float_division(self):
     ''' Make sure it deals gracefully with zero interval '''
     self.assertEqual(raw_analyze._compute_bottleneck_capacity(
       [(1234567894, 0, 1380)], 1440), None)
Exemple #10
0
 def test_ignore_small_mss(self):
     ''' Make sure we ignore samples <= than 1/2 MSS '''
     self.assertEqual(raw_analyze._compute_bottleneck_capacity(
       [(1234567894, 3, 720)], 1440), None)
Exemple #11
0
 def test_ignore_big_mss(self):
     ''' Make sure we ignore samples bigger than one MSS '''
     self.assertEqual(raw_analyze._compute_bottleneck_capacity(
       [(1234567894, 3, 1441)], 1440), None)
Exemple #12
0
 def test_empty(self):
     ''' Make sure it works for empty input '''
     self.assertEqual(raw_analyze._compute_bottleneck_capacity([], 1440),
       None)