Returns the total duration for one specific build chain run
962031
def total_build_duration_for_chain(self, build_chain_id):
        """"""
        return sum([
            int(self.__build_duration_for_id(id))
            for id in self.__build_ids_of_chain(build_chain_id)
        ])
1206237
def duration(self):
        
        with self.container.open_if_needed(mode='r') as cnt:
            samples, sr = cnt.get(self.key)

            return samples.shape[0] / sr
234409
private Double fetchBuildSuccessRatio(Iterable<Build> builds) {
    int totalBuilds = 0, totalSuccess = 0;
    for (Build build : builds) {
      if (Constants.IGNORE_STATUS.contains(build.getBuildStatus())) {
        continue;
      }

      totalBuilds++;
      if (Constants.SUCCESS_STATUS.contains(build.getBuildStatus())) {
        totalSuccess++;
      }
    }
    if (totalBuilds == 0) {
      return 0.0d;
    }
    return ((totalSuccess * 100) / (double) totalBuilds);
  }
1084643
def duration(self):
        """"""
        self._duration = self.lib.iperf_get_test_duration(self._test)
        return self._duration
1029657
def find_total_sequence_length(fasta_file):
    
    total_length = 0
    for sequence in SeqIO.parse(fasta_file, 'fasta'):
        total_length += len(sequence.seq)
    return total_length
830121
def jenkins_last_build_sha():
        
        job_url = os.getenv('JOB_URL')
        job_json_url = "{0}/api/json".format(job_url)
        response = urllib.urlopen(job_json_url)
        job_data = json.loads(response.read())

        last_completed_build_url = job_data['lastCompletedBuild']['url']
        last_complete_build_json_url = "{0}/api/json".format(last_completed_build_url)

        response = urllib.urlopen(last_complete_build_json_url)
        last_completed_build = json.loads(response.read())

        return last_completed_build[1]['lastBuiltRevision']['SHA1']
1176502
def get_build_output(self, process):
        

        while True:
            output = process.stdout.readline()
            if output == b'' and process.poll() is not None:
                if process.returncode > 0:
                    raise Exception("Compilation ended with an error"
                                    ".\nSTDERR\n%s\nSTDOUT\n%s" %
                                    (process.stderr.read(),
                                     process.stdout.read()))
                return
            if output:
                # Parse the output to get current and total tasks
                # This assumes the progress displayed by waf is in the form
                # [current/total]
                matches = re.search(r'\[\s*(\d+?)/(\d+)\].*',
                                    output.strip().decode('utf-8'))
                if matches is not None:
                    yield [int(matches.group(1)), int(matches.group(2))]
575357
def _duration(self):
        """"""
        duration = 0
        if self.state != STATE_IDLE:
            resp = self._player.query_duration(_FORMAT_TIME)
            duration = resp[1] // _NANOSEC_MULT
        return duration
893250
def average_build_duration(connection, package):
    
    if isinstance(package, str) and package.endswith('-container'):
        return average_last_builds(connection, package)
    return connection.getAverageBuildDuration(package)
797369
def DetermineRunner(bbdir):
    ''''''
    try:
        import buildbot_worker.scripts.runner
        tacfile = os.path.join(bbdir, 'buildbot.tac')

        if os.path.exists(tacfile):
            with open(tacfile, 'r') as f:
                contents = f.read()
                if 'import Worker' in contents:
                    return buildbot_worker.scripts.runner.run

    except ImportError:
        # Use the default
        pass

    import buildbot.scripts.runner
    return buildbot.scripts.runner.run
1150095
def total_duration(self):
        
        duration = 0

        for utterance in self.utterances.values():
            duration += utterance.duration

        return duration
25042
def total_duration(self):
        
        durations = [result.duration for result in self.data]
        return sum(durations)
627927
def _parse_last_build_date(self):
        
        date = self._channel.find('lastBuildDate').text
        date = parser.parse(date, ignoretz=True)
        return date
336890
def _find_last_good_run(build):
    """"""
    run_name = request.form.get('run_name', type=str)
    utils.jsonify_assert(run_name, 'run_name required')

    last_good_release = (
        models.Release.query
        .filter_by(
            build_id=build.id,
            status=models.Release.GOOD)
        .order_by(models.Release.created.desc())
        .first())

    last_good_run = None

    if last_good_release:
        logging.debug('Found last good release for: build_id=%r, '
                      'release_name=%r, release_number=%d',
                      build.id, last_good_release.name,
                      last_good_release.number)
        last_good_run = (
            models.Run.query
            .filter_by(release_id=last_good_release.id, name=run_name)
            .first())
        if last_good_run:
            logging.debug('Found last good run for: build_id=%r, '
                          'release_name=%r, release_number=%d, '
                          'run_name=%r',
                          build.id, last_good_release.name,
                          last_good_release.number, last_good_run.name)

    return last_good_release, last_good_run
1069922
def duration(self):
        
        d = self.for_attempt(self.cur_attempt)
        self.cur_attempt += 1
        return d
1192928
def log_end(path, log_file, sum_time):
    
    with open(path + log_file, "a") as log:
        log.seek(2)
        log.write("#" * 79 + "\n\n")
        log.write("Time : " + time.strftime("%H:%M:%S") + "\n")
        log.write("Total build time : {0}\n".format(sum_time))
        log.write(" " * 38 + "E N D\n\n")
        log.write("#" * 79 + "\n\n")
        log.close()
6560
private static double getDurationInSecs(
      ViewData.AggregationWindowData.CumulativeData cumulativeData) {
    return toDoubleSeconds(cumulativeData.getEnd().subtractTimestamp(cumulativeData.getStart()));
  }