コード例 #1
0
def get_benchmark_execution_complete(request, bench_exec_id):
    """ Returns a benchmark execution """
    data = {}
    data['menu'] = ViewPrepareObjects.prepare_menu_for_html([])

    exec_entry = BenchmarkExecutionEntry.objects.filter(
        id=bench_exec_id).first()

    if exec_entry is None:
        return res.get_template_data(request, 'presenter/not_found.html', data)

    obj = exec_entry.as_object()
    data[
        'results'] = ViewPrepareObjects.prepare_results_from_bench_exec_to_html(
            obj)
    data['url'] = {}
    data['url'][
        'invalidate'] = ViewUrlGenerator.get_benchmark_execution_invalidate_url(
            exec_entry.id)
    data['url'][
        'relevant'] = ViewUrlGenerator.get_benchmark_execution_relevant_url(
            exec_entry.id)

    return res.get_template_data(
        request, 'presenter/benchmark_execution_complete.html', data)
コード例 #2
0
def get_commit_ordered_by_worker(request, commit_id):
    """ Returns html for the commit executions ordered by worker """
    if request.method == 'GET':
        commit_entry = GitCommitEntry.objects.filter(id=commit_id).first()
        if not commit_entry:
            return res.get_template_data(request, 'presenter/not_found.html',
                                         {})

        ret = BenchmarkExecutionController.get_bench_execs_ordered_by_worker(
            commit_entry)

        if ret['commit']['parent']['id'] != None:
            com_id = ret['commit']['parent']['id']
            ret['commit']['parent'][
                'url'] = ViewUrlGenerator.get_commit_ordered_by_worker_url(
                    com_id)

        if ret['commit']['son']['id'] != None:
            com_id = ret['commit']['son']['id']
            ret['commit']['son'][
                'url'] = ViewUrlGenerator.get_commit_ordered_by_worker_url(
                    com_id)

        for worker in ret['workers']:
            executions = []
            for execution in worker['executions']:
                obj = {}
                obj['id'] = execution['id']
                obj['name'] = execution['name']
                obj['url'] = ViewUrlGenerator.get_benchmark_execution_relevant_url(
                    execution['id'])
                executions.append(obj)
            worker['executions'] = executions

        data = {}
        data['commit_data'] = ret
        data['menu'] = ViewPrepareObjects.prepare_menu_for_html([])

        return res.get_template_data(request,
                                     'presenter/commit_by_workers.html', data)
    else:
        return res.get_template_data(request, 'presenter/not_found.html', {})