Пример #1
0
def test_generator():
    # Test Data
    plot1 = PlotData('test1.csv', 1, 'GC Commit', 'MB', None, 600, 1200,
                     'line')
    plot2 = PlotData('test2.csv', 1, 'GC CMS Pause', 'seconds', None, 600,
                     1200, 'line')
    plot3 = PlotData('test3.csv', 1, 'GC Promo', 'bps', None, 600, 1200,
                     'line')
    plot4 = PlotData('test4.csv', 1, 'GC Promo', 'bps', None, 600, 1200,
                     'line')
    plot5 = PlotData('test5.csv', 1, 'GC Promo', 'bps', None, 600, 1200,
                     'line')
    yield plot, [plot1], 'test1', 'single plot with all valid csv', True
    yield plot, [plot1, plot2], 'test2', 'dual plot with all valid csv', True
    yield plot, [plot1, plot2,
                 plot3], 'test3', 'multi plot with all valid csv', True
    yield plot, [plot4], 'test4', 'single plot with 1 empty csv', False
    yield plot, [plot4, plot1], 'test5', 'dual plot with 1 empty csv', True
    yield plot, [plot1, plot4,
                 plot3], 'test6', 'multi plot with 1 empty csv', True
    yield plot, [plot5], 'test7', 'single plot with 1 non-existent csv', False
    yield plot, [plot5,
                 plot1], 'test8', 'dual plot with 1 non-existent csv', True
    yield plot, [plot1, plot5,
                 plot3], 'test9', 'multi plot with 1 non-existent csv', True
Пример #2
0
def nway_plotting(crossplots, metrics, output_directory, resource_path):
  listlen = len(crossplots)
  if listlen == 0:
    return ''
  i = 0
  correlated_plots = []
  #GC.appstop,all GC.alloc,GC.alloc-rate GC.promo,GC.gen0t,GC.gen0sys
  while i < listlen:
    plot = crossplots[i]
    vals = plot.split(',')
    i += 1
    if not 'all' in vals:
      plot_data = []
      for val in vals:
        csv_file = get_default_csv(output_directory, val)
        plot_data.append(PlotData(input_csv=csv_file, csv_column=1, series_name=sanitize_string(val), y_label=sanitize_string(val), precision=None, graph_height=500, graph_width=1200, graph_type='line'))
      png_name = get_merged_plot_link_name(vals)
      graphed, div_file = Metric.graphing_modules['matplotlib'].graph_data(plot_data, output_directory, resource_path, png_name)
      if graphed:
        correlated_plots.append(div_file)
    else:
      vals.remove('all')
      for metric in metrics:
        for csv in metric.csv_files:
          csv_filename = csv.split('/')[-1]
          metric_name = '.'.join(csv_filename.split('.')[0:-1])
          if metric_name in vals:
            continue
          new_val = []
          new_val.extend(vals)
          new_val.append(metric_name)
          new_val_str = ','.join(new_val)
          crossplots.append(new_val_str)
          listlen += 1
  return correlated_plots