def test_tryjobverifier_first_run_durations(self):
     self.analyze_records(
         (1, {"issue": 1, "patchset": 1, "action": "patch_start"}),
         (2, {"issue": 1, "patchset": 1, "action": "verifier_start"}),
         (3, {"issue": 1, "patchset": 1, "action": "verifier_retry"}),
         (4, {"issue": 1, "patchset": 1, "action": "verifier_pass"}),
         (5, {"issue": 1, "patchset": 1, "action": "patch_stop"}),
         (6, {"issue": 2, "patchset": 1, "action": "patch_start"}),
         (7, {"issue": 2, "patchset": 1, "action": "verifier_start"}),
         (8, {"issue": 2, "patchset": 1, "action": "verifier_timeout"}),
         (9, {"issue": 2, "patchset": 1, "action": "patch_stop"}),
         (10, {"issue": 2, "patchset": 1, "action": "patch_start"}),
         (11, {"issue": 2, "patchset": 1, "action": "verifier_start"}),
         (15, {"issue": 2, "patchset": 1, "action": "verifier_fail"}),
         (16, {"issue": 2, "patchset": 1, "action": "patch_stop"}),
         (17, {"issue": 3, "patchset": 1, "action": "patch_start"}),
         (18, {"issue": 3, "patchset": 1, "action": "verifier_start"}),
         (21, {"issue": 3, "patchset": 1, "action": "verifier_pass"}),
         (22, {"issue": 3, "patchset": 1, "action": "patch_stop"}),
     )
     self.assertEquals(
         self.create_list(
             name="tryjobverifier-first-run-durations",
             description="Time spent on each tryjob verifier first run.",
             unit="seconds",
             points=(
                 (hours(1), PatchsetReference(1, 1)),
                 (hours(1), PatchsetReference(2, 1)),
                 (hours(4), PatchsetReference(2, 1)),
                 (hours(3), PatchsetReference(3, 1)),
             ),
         ),
         self.get_stats("tryjobverifier-first-run-durations"),
     )
 def test_patchset_durations(self):
   self.analyze_records(
     (1, {'issue': 1, 'patchset': 1, 'action': 'patch_start'}),
     (2, {'issue': 1, 'patchset': 1, 'action': 'patch_stop'}),
     (3, {'issue': 1, 'patchset': 2, 'action': 'patch_start'}),
     (5, {'issue': 1, 'patchset': 2, 'action': 'patch_stop'}),
     (6, {'issue': 2, 'patchset': 1, 'action': 'patch_start'}),
     (7, {'issue': 2, 'patchset': 1, 'action': 'patch_stop'}),
     (8, {'issue': 2, 'patchset': 1, 'action': 'patch_start'}),
     (10, {'issue': 2, 'patchset': 1, 'action': 'patch_stop'}),
     (10, {'issue': 2, 'patchset': 2, 'action': 'patch_start'}),
     (20, {'issue': 2, 'patchset': 2, 'action': 'patch_stop'}),
   )
   self.assertEquals(self.create_list(
       name='patchset-durations',
       description=('Total time spent in the CQ per patchset, '
                    'counts multiple CQ attempts as one.'),
       unit='seconds',
       points=(
         (hours(1), PatchsetReference(1, 1)),
         (hours(2), PatchsetReference(1, 2)),
         (hours(3), PatchsetReference(2, 1)),
         (hours(10), PatchsetReference(2, 2)),
       ),
     ), self.get_stats('patchset-durations'))
 def test_tryjobverifier_total_durations(self):
     self.analyze_records(
         (1, {"issue": 1, "patchset": 1, "action": "patch_start"}),
         (2, {"issue": 1, "patchset": 1, "action": "verifier_start"}),
         (3, {"issue": 1, "patchset": 1, "action": "verifier_pass"}),
         (4, {"issue": 1, "patchset": 1, "action": "patch_stop"}),
         (5, {"issue": 1, "patchset": 1, "action": "patch_start"}),
         (6, {"issue": 1, "patchset": 1, "action": "verifier_start"}),
         (10, {"issue": 1, "patchset": 1, "action": "verifier_fail"}),
         (11, {"issue": 1, "patchset": 1, "action": "patch_stop"}),
         (12, {"issue": 1, "patchset": 2, "action": "patch_start"}),
         (13, {"issue": 1, "patchset": 2, "action": "verifier_start"}),
         (14, {"issue": 1, "patchset": 2, "action": "verifier_retry"}),
         (20, {"issue": 1, "patchset": 2, "action": "verifier_timeout"}),
         (21, {"issue": 1, "patchset": 2, "action": "patch_stop"}),
     )
     self.assertEquals(
         self.create_list(
             name="tryjobverifier-total-durations",
             description="Total time spent per CQ attempt on tryjob verifier runs.",
             unit="seconds",
             points=(
                 (hours(1), PatchsetReference(1, 1)),
                 (hours(4), PatchsetReference(1, 1)),
                 (hours(7), PatchsetReference(1, 2)),
             ),
         ),
         self.get_stats("tryjobverifier-total-durations"),
     )
 def test_blocked_on_throttled_tree_durations(self):
   self.analyze_records(
     (1, {'issue': 1, 'patchset': 1, 'action': 'patch_start'}),
     (2, {'issue': 1, 'patchset': 1, 'action': 'patch_throttled'}),
     (3, {'issue': 1, 'patchset': 1, 'action': 'patch_ready_to_commit'}),
     (4, {'issue': 1, 'patchset': 1, 'action': 'patch_stop'}),
     (5, {'issue': 2, 'patchset': 1, 'action': 'patch_start'}),
     (6, {'issue': 2, 'patchset': 1, 'action': 'patch_throttled'}),
     (9, {'issue': 2, 'patchset': 1, 'action': 'patch_ready_to_commit'}),
     (10, {'issue': 2, 'patchset': 1, 'action': 'patch_stop'}),
     (11, {'issue': 3, 'patchset': 2, 'action': 'patch_start'}),
     (12, {'issue': 3, 'patchset': 2, 'action': 'patch_throttled'}),
     (14, {'issue': 3, 'patchset': 2, 'action': 'patch_stop'}),
     (15, {'issue': 4, 'patchset': 2, 'action': 'patch_start'}),
     (19, {'issue': 4, 'patchset': 2, 'action': 'patch_ready_to_commit'}),
     (20, {'issue': 4, 'patchset': 2, 'action': 'patch_stop'}),
   )
   self.assertEquals(self.create_list(
       name='blocked-on-throttled-tree-durations',
       description=('Time spent per committed patchset '
                    'blocked on a throttled tree.'),
       unit='seconds',
       points=(
         (hours(1), PatchsetReference(1, 1)),
         (hours(3), PatchsetReference(2, 1)),
         (hours(0), PatchsetReference(4, 2)),
       ),
     ), self.get_stats('blocked-on-throttled-tree-durations'))
 def test_patchset_total_wall_time_durations(self):
   self.analyze_records(*self.historical_records)
   self.assertEquals(self.create_list(
     name='patchset-total-wall-time-durations',
     description='Total time per patch since their commit box was checked.',
     unit='seconds',
     points=(
       (hours(36), PatchsetReference(1, 2)),
       (hours(5), PatchsetReference(1, 3)),
     ),
   ), self.get_stats('patchset-total-wall-time-durations'))
 def test_patchset_total_commit_queue_durations(self):
   self.analyze_records(*self.historical_records)
   self.assertEquals(self.create_list(
     name='patchset-total-commit-queue-durations',
     description='Total time spent in the CQ per patch.',
     unit='seconds',
     points=(
       (hours(11), PatchsetReference(1, 2)),
       (hours(5), PatchsetReference(1, 3)),
     ),
   ), self.get_stats('patchset-total-commit-queue-durations'))
Beispiel #7
0
 def test_patchset_total_commit_queue_durations(self):
     self.analyze_records(*self.historical_records)
     self.assertEquals(
         self.create_list(
             name='patchset-total-commit-queue-durations',
             description='Total time spent in the CQ per patch.',
             unit='seconds',
             points=(
                 (hours(11), PatchsetReference(1, 2)),
                 (hours(5), PatchsetReference(1, 3)),
             ),
         ), self.get_stats('patchset-total-commit-queue-durations'))
 def test_attempt_durations(self):
   self.analyze_records(*self.attempt_records)
   self.assertEquals(self.create_list(
       name='attempt-durations',
       description='Total time spent per CQ attempt.',
       unit='seconds',
       points=(
         (hours(2), PatchsetReference(1, 1)),
         (hours(10), PatchsetReference(1, 1)),
         (hours(12), PatchsetReference(2, 1)),
       ),
     ), self.get_stats('attempt-durations'))
 def test_patchset_commit_durations(self):
   self.analyze_records(*self.patchset_commit_records)
   self.assertEquals(self.create_list(
       name='patchset-commit-durations',
       description=('Time taken by the CQ to land a patch '
                    'after passing all checks.'),
       unit='seconds',
       points=(
         (hours(1), PatchsetReference(2, 1)),
         (hours(4), PatchsetReference(3, 2)),
       ),
     ), self.get_stats('patchset-commit-durations'))
Beispiel #10
0
 def test_patchset_commit_durations(self):
     self.analyze_records(*self.patchset_commit_records)
     self.assertEquals(
         self.create_list(
             name='patchset-commit-durations',
             description=('Time taken by the CQ to land a patch '
                          'after passing all checks.'),
             unit='seconds',
             points=(
                 (hours(1), PatchsetReference(2, 1)),
                 (hours(4), PatchsetReference(3, 2)),
             ),
         ), self.get_stats('patchset-commit-durations'))
Beispiel #11
0
 def test_attempt_durations(self):
     self.analyze_records(*self.attempt_records)
     self.assertEquals(
         self.create_list(
             name='attempt-durations',
             description='Total time spent per CQ attempt.',
             unit='seconds',
             points=(
                 (hours(2), PatchsetReference(1, 1)),
                 (hours(10), PatchsetReference(1, 1)),
                 (hours(12), PatchsetReference(2, 1)),
             ),
         ), self.get_stats('attempt-durations'))
Beispiel #12
0
 def test_patchset_total_wall_time_durations(self):
     self.analyze_records(*self.historical_records)
     self.assertEquals(
         self.create_list(
             name='patchset-total-wall-time-durations',
             description=
             'Total time per patch since their commit box was checked.',
             unit='seconds',
             points=(
                 (hours(36), PatchsetReference(1, 2)),
                 (hours(5), PatchsetReference(1, 3)),
             ),
         ), self.get_stats('patchset-total-wall-time-durations'))
Beispiel #13
0
 def test_patchset_durations(self):
     self.analyze_records(
         (1, {
             'issue': 1,
             'patchset': 1,
             'action': 'patch_start'
         }),
         (2, {
             'issue': 1,
             'patchset': 1,
             'action': 'patch_stop'
         }),
         (3, {
             'issue': 1,
             'patchset': 2,
             'action': 'patch_start'
         }),
         (5, {
             'issue': 1,
             'patchset': 2,
             'action': 'patch_stop'
         }),
         (6, {
             'issue': 2,
             'patchset': 1,
             'action': 'patch_start'
         }),
         (7, {
             'issue': 2,
             'patchset': 1,
             'action': 'patch_stop'
         }),
         (8, {
             'issue': 2,
             'patchset': 1,
             'action': 'patch_start'
         }),
         (10, {
             'issue': 2,
             'patchset': 1,
             'action': 'patch_stop'
         }),
         (10, {
             'issue': 2,
             'patchset': 2,
             'action': 'patch_start'
         }),
         (20, {
             'issue': 2,
             'patchset': 2,
             'action': 'patch_stop'
         }),
     )
     self.assertEquals(
         self.create_list(
             name='patchset-durations',
             description=('Total time spent in the CQ per patchset, '
                          'counts multiple CQ attempts as one.'),
             unit='seconds',
             points=(
                 (hours(1), PatchsetReference(1, 1)),
                 (hours(2), PatchsetReference(1, 2)),
                 (hours(3), PatchsetReference(2, 1)),
                 (hours(10), PatchsetReference(2, 2)),
             ),
         ), self.get_stats('patchset-durations'))
Beispiel #14
0
 def test_blocked_on_throttled_tree_durations(self):
     self.analyze_records(
         (1, {
             'issue': 1,
             'patchset': 1,
             'action': 'patch_start'
         }),
         (2, {
             'issue': 1,
             'patchset': 1,
             'action': 'patch_throttled'
         }),
         (3, {
             'issue': 1,
             'patchset': 1,
             'action': 'patch_ready_to_commit'
         }),
         (4, {
             'issue': 1,
             'patchset': 1,
             'action': 'patch_stop'
         }),
         (5, {
             'issue': 2,
             'patchset': 1,
             'action': 'patch_start'
         }),
         (6, {
             'issue': 2,
             'patchset': 1,
             'action': 'patch_throttled'
         }),
         (9, {
             'issue': 2,
             'patchset': 1,
             'action': 'patch_ready_to_commit'
         }),
         (10, {
             'issue': 2,
             'patchset': 1,
             'action': 'patch_stop'
         }),
         (11, {
             'issue': 3,
             'patchset': 2,
             'action': 'patch_start'
         }),
         (12, {
             'issue': 3,
             'patchset': 2,
             'action': 'patch_throttled'
         }),
         (14, {
             'issue': 3,
             'patchset': 2,
             'action': 'patch_stop'
         }),
         (15, {
             'issue': 4,
             'patchset': 2,
             'action': 'patch_start'
         }),
         (19, {
             'issue': 4,
             'patchset': 2,
             'action': 'patch_ready_to_commit'
         }),
         (20, {
             'issue': 4,
             'patchset': 2,
             'action': 'patch_stop'
         }),
     )
     self.assertEquals(
         self.create_list(
             name='blocked-on-throttled-tree-durations',
             description=('Time spent per committed patchset '
                          'blocked on a throttled tree.'),
             unit='seconds',
             points=(
                 (hours(1), PatchsetReference(1, 1)),
                 (hours(3), PatchsetReference(2, 1)),
                 (hours(0), PatchsetReference(4, 2)),
             ),
         ), self.get_stats('blocked-on-throttled-tree-durations'))
Beispiel #15
0
 def test_tryjobverifier_first_run_durations(self):
     self.analyze_records(
         (1, {
             'issue': 1,
             'patchset': 1,
             'action': 'patch_start'
         }),
         (2, {
             'issue': 1,
             'patchset': 1,
             'action': 'verifier_start'
         }),
         (3, {
             'issue': 1,
             'patchset': 1,
             'action': 'verifier_retry'
         }),
         (4, {
             'issue': 1,
             'patchset': 1,
             'action': 'verifier_pass'
         }),
         (5, {
             'issue': 1,
             'patchset': 1,
             'action': 'patch_stop'
         }),
         (6, {
             'issue': 2,
             'patchset': 1,
             'action': 'patch_start'
         }),
         (7, {
             'issue': 2,
             'patchset': 1,
             'action': 'verifier_start'
         }),
         (8, {
             'issue': 2,
             'patchset': 1,
             'action': 'verifier_timeout'
         }),
         (9, {
             'issue': 2,
             'patchset': 1,
             'action': 'patch_stop'
         }),
         (10, {
             'issue': 2,
             'patchset': 1,
             'action': 'patch_start'
         }),
         (11, {
             'issue': 2,
             'patchset': 1,
             'action': 'verifier_start'
         }),
         (15, {
             'issue': 2,
             'patchset': 1,
             'action': 'verifier_fail'
         }),
         (16, {
             'issue': 2,
             'patchset': 1,
             'action': 'patch_stop'
         }),
         (17, {
             'issue': 3,
             'patchset': 1,
             'action': 'patch_start'
         }),
         (18, {
             'issue': 3,
             'patchset': 1,
             'action': 'verifier_start'
         }),
         (21, {
             'issue': 3,
             'patchset': 1,
             'action': 'verifier_pass'
         }),
         (22, {
             'issue': 3,
             'patchset': 1,
             'action': 'patch_stop'
         }),
     )
     self.assertEquals(
         self.create_list(
             name='tryjobverifier-first-run-durations',
             description='Time spent on each tryjob verifier first run.',
             unit='seconds',
             points=(
                 (hours(1), PatchsetReference(1, 1)),
                 (hours(1), PatchsetReference(2, 1)),
                 (hours(4), PatchsetReference(2, 1)),
                 (hours(3), PatchsetReference(3, 1)),
             ),
         ), self.get_stats('tryjobverifier-first-run-durations'))
Beispiel #16
0
 def test_tryjobverifier_total_durations(self):
     self.analyze_records(
         (1, {
             'issue': 1,
             'patchset': 1,
             'action': 'patch_start'
         }),
         (2, {
             'issue': 1,
             'patchset': 1,
             'action': 'verifier_start'
         }),
         (3, {
             'issue': 1,
             'patchset': 1,
             'action': 'verifier_pass'
         }),
         (4, {
             'issue': 1,
             'patchset': 1,
             'action': 'patch_stop'
         }),
         (5, {
             'issue': 1,
             'patchset': 1,
             'action': 'patch_start'
         }),
         (6, {
             'issue': 1,
             'patchset': 1,
             'action': 'verifier_start'
         }),
         (10, {
             'issue': 1,
             'patchset': 1,
             'action': 'verifier_fail'
         }),
         (11, {
             'issue': 1,
             'patchset': 1,
             'action': 'patch_stop'
         }),
         (12, {
             'issue': 1,
             'patchset': 2,
             'action': 'patch_start'
         }),
         (13, {
             'issue': 1,
             'patchset': 2,
             'action': 'verifier_start'
         }),
         (14, {
             'issue': 1,
             'patchset': 2,
             'action': 'verifier_retry'
         }),
         (20, {
             'issue': 1,
             'patchset': 2,
             'action': 'verifier_timeout'
         }),
         (21, {
             'issue': 1,
             'patchset': 2,
             'action': 'patch_stop'
         }),
     )
     self.assertEquals(
         self.create_list(
             name='tryjobverifier-total-durations',
             description=
             'Total time spent per CQ attempt on tryjob verifier runs.',
             unit='seconds',
             points=(
                 (hours(1), PatchsetReference(1, 1)),
                 (hours(4), PatchsetReference(1, 1)),
                 (hours(7), PatchsetReference(1, 2)),
             ),
         ), self.get_stats('tryjobverifier-total-durations'))