def PerRunDurationBarGraph(run_data, scale=None):
  chart = google_chart_api.BarChart()
  chart.vertical = False
  chart.bottom.label_gridlines = True
  chart.bottom.label_positions = chart.bottom.labels

  max_run_avg = -1
  runs = {}
  for (ns, run_averages) in run_data:
    chart.left.labels.append(ns)
    for run_num, run_avg in enumerate(run_averages):
      if run_num not in runs:
        runs[run_num] = []

      runs[run_num].append(run_avg)
      if run_avg > max_run_avg:
        max_run_avg = run_avg

  if max_run_avg < 0:
    print "No decent data to graph: %s" % run_data
    return None

  if not scale:
    scale = int(math.ceil(max_run_avg / 5) * 5)

  if len(runs) == 1:
    bar_count = len(runs[0])
    chart.AddBars(runs[0])
  else:
    bar_count = 0
    for run_num in sorted(runs):
      bar_count += len(runs[run_num])
      chart.AddBars(runs[run_num], label='Run %s' % (run_num+1),
                    color=DarkenHexColorCode('4684ee', run_num*3))

  tick = _GoodTicks(scale, num_ticks=15.0)
  labels = range(0, scale, tick) + [scale]
  chart.bottom.min = 0
  chart.display.enhanced_encoding = True
  bottom_axis = chart.AddAxis('x', common.Axis())
  bottom_axis.labels = ['Duration in ms.']
  bottom_axis.label_positions = [int((max_run_avg/2.0)*.9)]
  chart.bottom.labels = labels
  chart.bottom.max = labels[-1]
  return chart.display.Url(CHART_WIDTH, _BarGraphHeight(bar_count))
Called if a job hasn't changed in a while.
dataset/ETHPy150Open catap/namebench/libnamebench/charts.py/PerRunDurationBarGraph--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/cli.py/StdioJobPollReportCb.ReportNotChanged