l.b.queuedepth : module documentation

Part of lp.buildmaster

No module docstring
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.
def get_builder_data():
How many working builders are there, how are they configured?
def get_free_builders_count(processor, virtualized):
How many builders capable of running jobs for the given processor and virtualization combination are idle/free at present?
def get_head_job_platform(bq):
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.
def estimate_time_to_next_builder(bq, now=None):

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.

ReturnsThe estimated number of seconds untils a builder capable of running the head job becomes available.
def get_pending_jobs_clauses(bq):
WHERE clauses for pending job queries, used for dipatch time estimation.
def estimate_job_delay(bq, builder_stats):
Sum of estimated durations for pending jobs ahead in queue.

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.

Parametersbuilder_statsA 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.
ReturnsAn integer value holding the sum of delays (in seconds) caused by the jobs that are ahead of and competing with the JOI.
def estimate_job_start_time(bq, now=None):
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)
API Documentation for Launchpad, generated by pydoctor at 2018-08-14 00:00:04.