Skip to content

API improvement suggestion for creating a benchmark from a generated instance #89

@henricasanova

Description

@henricasanova

At the moment, the (example) code for generating a benchmark from a generated instance is:

       workflow = BlastRecipe.from_num_tasks(500).build_workflow()
        benchmark = WorkflowBenchmark(recipe=BlastRecipe, num_tasks=500)
        dirpath = pathlib.Path("/tmp/benchmark/")
        dirpath.mkdir(parents=True, exist_ok=True)
        path = benchmark.create_benchmark_from_synthetic_workflow(dirpath, workflow, cpu_work=100, percent_cpu=0.6)

It is counter-intuitive that the WorkflowBenchmark constructor takes the recipe and the number of tasks, since the create_benchmark() method takes in the workflow. I am wondering whether the constructor could take nothing, and there there would be a create_benchmark_from_recipe() method and a create_benchmark_from_synthetic_workflow() method. Or, better, a polymorphic create_benchmark() method?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions