Logo Search packages:      
Sourcecode: namebench version File versions  Download package

def libnamebench::benchmark::Benchmark::ComputeAverages (   self  ) 

Process all runs for all hosts, yielding an average for each host.

Definition at line 158 of file benchmark.py.

00158                            :
    """Process all runs for all hosts, yielding an average for each host."""
    for ns in self.results:
      record_count = 0
      failure_count = 0
      nx_count = 0
      run_averages = []

      for test_run in self.results[ns]:
        record_count += len(test_run)
        # x: record, req_type, duration, response
        failure_count += len([x for x in test_run if not x[3]])
        nx_count += len([x for x in test_run if x[3] and not x[3].answer])
        duration = sum([x[2] for x in test_run])
        run_averages.append(duration / len(test_run))

      # This appears to be a safe use of averaging averages
      overall_average = util.CalculateListAverage(run_averages)
      (fastest, slowest) = self.FastestAndSlowestDurationForNameServer(ns)

      yield (ns, overall_average, run_averages, fastest, slowest,
             failure_count, nx_count)

  def FastestAndSlowestDurationForNameServer(self, ns):


Generated by  Doxygen 1.6.0   Back to index