示例#1
0
def main(**args):

    print args
    # Stage exams
    aud = exam.Auditor(processes=args['p'])
    for test in args['test']:
        test_type = getattr(sys.modules[exam.__name__], test)
        aud.stage(test_type,
                  min_time=args['s'],
                  min_hosts=args['N'],
                  waynesses=args['waynesses'],
                  aggregate=args['a'],
                  ignore_status=args['ignore_status'])

        print 'Staging test: ' + test_type.__name__

    # Compute metrics for exams
    aud.run(get_filelist(args['start'], args['end'], pickles_dir=args['dir']))

    # Test metrics for pass/fail.  Print results
    failed_jobs = {}
    for test in args['test']:
        if len(args['t']) > 1: threshold = args['t'][args['test'].index(test)]
        else: threshold = args['t']

        test_type = getattr(sys.modules[exam.__name__], test)
        aud.test(test_type, threshold)
        failed_jobs[test_type.__name__] = test_report(aud, test_type)

    # Make plots if desired
    if not args['plot']: return failed_jobs
    for test in args['test']:
        if len(args['t']) > 1: threshold = args['t'][args['test'].index(test)]
        else: threshold = args['t']

        test_type = getattr(sys.modules[exam.__name__], test)
        plotter = plot.MasterPlot(header='Failed test: ' + test_type.__name__,
                                  prefix=test_type.__name__,
                                  outdir=args['o'],
                                  processes=args['p'],
                                  threshold=threshold,
                                  wide=args['wide'],
                                  save=True)
        plotter.run(failed_jobs[test_type.__name__])
    return failed_jobs
示例#2
0
def masterplot_test():
    plotter = plots.MasterPlot(mode='lines',
                               outdir='.',
                               prefix='imbalance',
                               header='Potentially Imbalanced',
                               lariat_data='pass',
                               wide=True,
                               save=True)
    plotter.plot(filelist[0])
    assert os.path.isfile(plotter.outdir + '/' + plotter.fname + '.pdf')
    os.remove(plotter.fname + '.pdf')
    plotter.mode = 'percentile'
    plotter.header = 'Potentially Imbalanced (%)'
    plotter.plot(filelist[0])
    assert os.path.isfile(plotter.outdir + '/' + plotter.fname + '.pdf')
    os.remove(plotter.fname + '.pdf')
    plotter.mode = 'lines'
    plotter.prefix = 'step'
    plotter.header = 'Step Function Performance'
    plotter.plot(filelist[0])
    assert os.path.isfile(plotter.outdir + '/' + plotter.fname + '.pdf')
    os.remove(plotter.fname + '.pdf')
示例#3
0
def master_plot(request, pk):
    data = get_data(pk)
    mp = plots.MasterPlot()
    mp.plot(pk, job_data=data)
    return figure_to_response(mp)
示例#4
0
def master_plot(pk):
    data = get_data(pk)
    mp = plots.MasterPlot()
    return components(mp.plot(data))