gitlab-org--gitlab-foss/spec/lib
Rémy Coutable eb2d20665f Merge branch 'smart-pipeline-duration' into 'master'
Smartly calculate real running time and pending time

## What does this MR do?

Try to smartly calculate the running time and pending time for pipelines, instead of just use wall clock time from start to end. The algorithm is based on:

> Suppose we have A, B, and C jobs:

> * A: from 1 to 3
> * B: from 2 to 4
> * C: from 6 to 7

> The processing time should be accumulated from 1 to 4, and 6 to 7, totally 4, excluding retires, and calculate on `%w[success failed running canceled]` jobs (if a job is not finished yet, assume it's `Time.now`)

## Are there points in the code the reviewer needs to double check?

I would actually like to test `Gitlab::Ci::PipelineDuration#process_segments`, but it's a private method right now and it's not very convenient to test it. Is there a way to test it without changing the original code too much? Note that I would like to avoid saving merged segments because it's not used and should be garbage collected.

## Screenshots:

![Screen_Shot_2016-09-05_at_6.45.32_PM](/uploads/a82bfaf316661091e383b743a2f11334/Screen_Shot_2016-09-05_at_6.45.32_PM.png)

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- Tests
  - [x] Added for this feature/bug

## What are the relevant issue numbers?

Closes #18260, #19804

See merge request !6084
2016-09-08 17:38:20 +00:00
..
banzai Merge branch 'js-tooltips-for-mentions' into 'master' 2016-09-01 14:36:09 +00:00
ci Fix invalid curl command 2016-09-07 12:19:36 +02:00
container_registry Explicitly remove authorization token and make sure that invalid addresses are properly handled 2016-07-15 17:35:23 +02:00
gitlab Merge branch 'smart-pipeline-duration' into 'master' 2016-09-08 17:38:20 +00:00
json_web_token Revert "Fix merge conflicts - squashed commit" 2016-06-03 11:10:17 +02:00
disable_email_interceptor_spec.rb adds second batch of tests changed to active tense 2016-08-09 15:11:39 +01:00
extracts_path_spec.rb Add failing test for #21334 2016-08-24 02:18:38 +02:00
file_size_validator_spec.rb
git_ref_validator_spec.rb
gitlab_spec.rb Update Gitlab.com? to support staging 2016-06-27 15:10:36 -04:00
repository_cache_spec.rb Use project ID in repository cache to prevent stale data from persisting across projects 2016-07-25 05:09:28 -07:00