예제 #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)
예제 #2
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)
예제 #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)
예제 #4
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)
예제 #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)
예제 #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)
예제 #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)
예제 #8
0
 def test_empty(self):
     ''' Make sure it works for empty input '''
     self.assertEqual(raw_analyze._compute_bottleneck_capacity([], 1440),
                      None)
예제 #9
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)
예제 #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)
예제 #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)
예제 #12
0
 def test_empty(self):
     ''' Make sure it works for empty input '''
     self.assertEqual(raw_analyze._compute_bottleneck_capacity([], 1440),
       None)