Commit graph

19 commits

Author SHA1 Message Date
Lin Jen-Shin
822efd5c3b Struct.new could take a block for defining methods, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_15091858
2016-09-08 23:55:07 +08:00
Lin Jen-Shin
27a3f1182a Split try_merge_period into overlap? and merge:
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_15083507
2016-09-08 21:49:17 +08:00
Lin Jen-Shin
61bc90af0e Be more specific since it's not needed to be generic now,
feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14995016
2016-09-06 19:57:51 +08:00
Lin Jen-Shin
7351c269de Sort by database, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14991226
and
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14994233
2016-09-06 19:36:07 +08:00
Lin Jen-Shin
3a68c98973 Just use module because there's nothing to save, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14992064
2016-09-06 19:14:28 +08:00
Lin Jen-Shin
b92c75ab98 Use sum, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14991392
2016-09-06 18:12:46 +08:00
Lin Jen-Shin
d071f61b0d Forget about pending duration for now, need more discussion 2016-09-05 17:55:30 +08:00
Lin Jen-Shin
7aaed299eb Just sum all the queuing time, indication for needing more runners 2016-09-02 23:43:10 +08:00
Lin Jen-Shin
defd889905 Actually we still need to use total - running to get:
real pending time, because that's actually by definition,
(the time that it's not running!)
or we could end up with awfully complicated algorithm :(
2016-09-02 21:08:26 +08:00
Lin Jen-Shin
39c090fecb Calculate real queueing time to exclude gaps from:
retries and probably also manual actions!

Feedback:

* https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14735478
* https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14737804
2016-09-02 19:15:42 +08:00
Lin Jen-Shin
d2cfcb3ec1 Use guard clause, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6084#note_14754681
2016-08-31 16:48:29 +08:00
Lin Jen-Shin
1e49a8bc6c Introduction to PipelineDuration 2016-08-31 03:09:16 +08:00
Lin Jen-Shin
f10a1e331d Fix renaming 2016-08-30 23:11:57 +08:00
Lin Jen-Shin
2af2b78e49 Avoid shadowing method name. Just use existing method 2016-08-30 23:08:25 +08:00
Lin Jen-Shin
1f6efa352c Rename to periods since it's easier to understand 2016-08-30 23:06:29 +08:00
Lin Jen-Shin
bd78e6af29 Use algorithm from Kamil:
Excluding sorting, this is O(n) which should be much faster and
much simpler and easier to understand.
2016-08-30 23:02:39 +08:00
Lin Jen-Shin
7e32e2ef20 build might not start yet 2016-08-30 02:53:53 +08:00
Lin Jen-Shin
e9e7c3788d no builds no pending 2016-08-29 23:40:15 +08:00
Lin Jen-Shin
ace0a005b8 Smartly calculate real running time and pending time 2016-08-29 20:24:48 +08:00