benchbuild.utils.db module

Database support module for the benchbuild study.

benchbuild.utils.db.create_run(cmd, project, exp, grp)[source]

Create a new ‘run’ in the database.

This creates a new transaction in the database and creates a new run in this transaction. Afterwards we return both the transaction as well as the run itself. The user is responsible for committing it when the time comes.

Parameters:
  • cmd – The command that has been executed.
  • prj – The project this run belongs to.
  • exp – The experiment this run belongs to.
  • grp – The run_group (uuid) we blong to.
Returns:

The inserted tuple representing the run and the session opened with the new run. Don’t forget to commit it at some point.

benchbuild.utils.db.create_run_group(prj)[source]

Create a new ‘run_group’ in the database.

This creates a new transaction in the database and creates a new run_group within this transaction. Afterwards we return both the transaction as well as the run_group itself. The user is responsible for committing it when the time comes.

Parameters:- The project for which we open the run_group. (prj) –
Returns:A tuple (group, session) containing both the newly created run_group and the transaction object.
benchbuild.utils.db.persist_compilestats(run, session, stats)[source]

Persist the run results in the database.

Parameters:
  • run – The run we attach the compilestats to.
  • session – The db transaction we belong to.
  • stats – The stats we want to store in the database.
benchbuild.utils.db.persist_config(run, session, cfg)[source]

Persist the configuration in as key-value pairs.

Parameters:
  • run – The run we attach the config to.
  • session – The db transaction we belong to.
  • cfg – The configuration we want to persist.
benchbuild.utils.db.persist_experiment(experiment)[source]

Persist this experiment in the benchbuild database.

Parameters:experiment – The experiment we want to persist.
benchbuild.utils.db.persist_perf(run, session, svg_path)[source]

Persist the flamegraph in the database.

The flamegraph exists as a SVG image on disk until we persist it in the database.

Parameters:
  • run – The run we attach these perf measurements to.
  • session – The db transaction we belong to.
  • svg_path – The path to the SVG file we want to store.
benchbuild.utils.db.persist_project(project)[source]

Persist this project in the benchbuild database.

Parameters:project – The project we want to persist.
benchbuild.utils.db.persist_time(run, session, *args, **kwargs)[source]
benchbuild.utils.db.validate(func)[source]