Part of lp.buildmaster
Function | get_builder_data | How many working builders are there, how are they configured? |
Function | get_free_builders_count | How many builders capable of running jobs for the given processor |
Function | get_head_job_platform | Find the processor and virtualization setting for the head job. |
Function | estimate_time_to_next_builder | Estimate time until next builder becomes available. |
Function | get_pending_jobs_clauses | WHERE clauses for pending job queries, used for dipatch time |
Function | estimate_job_delay | Sum of estimated durations for pending jobs ahead in queue. |
Function | estimate_job_start_time | Estimate the start time of the given IBuildQueue . |
Find the processor and virtualization setting for the head job. Among the jobs that compete with the job of interest (JOI) for builders and are queued ahead of it the head job is the one in pole position i.e. the one to be dispatched to a builder next. :return: A (processor, virtualized) tuple which is the head job's platform or None if the JOI is the head job.
Estimate time until next builder becomes available.
For the purpose of estimating the dispatch time of the job of interest (JOI) we need to know how long it will take until the job at the head of JOI's queue is dispatched.
There are two cases to consider here: the head job is
- processor dependent: only builders with the matching
processor/virtualization combination should be considered.
- not processor dependent: all builders with the matching
virtualization setting should be considered.
Returns | The estimated number of seconds untils a builder capable of running the head job becomes available. |
For the purpose of estimating the dispatch time of the job of interest (JOI) we need to know the delay caused by all the pending jobs that are ahead of the JOI in the queue and that compete with it for builders.
Parameters | builder_stats | A dictionary with builder counts where the key is a (processor, virtualized) combination (aka "platform") and the value is the number of builders that can take on jobs requiring that combination. |
Returns | An integer value holding the sum of delays (in seconds) caused by the jobs that are ahead of and competing with the JOI. |
Estimate the start time of the given `IBuildQueue`. The estimated dispatch time for the build farm job at hand is calculated from the following ingredients: * the start time for the head job (job at the head of the respective build queue) * the estimated build durations of all jobs that precede the job of interest (JOI) in the build queue (divided by the number of machines in the respective build pool)