pcvs.backend.bank module
- pcvs.backend.bank.BANKS: Dict[str, str] = {}
- Variables
BANKS – list of available banks when PCVS starts up
- class pcvs.backend.bank.Bank(path: Optional[str] = None, token: str = '')[source]
Bases:
Bank
Representation of a PCVS result datastore.
Stored as a Git repo, a bank hold multiple results to be scanned and used to analyse benchmarks result over time. A single bank can manipulate namespaces (referred as ‘projects’). The namespace is provided by suffixing
@proj
to the original name.- Parameters
root (str) – the root bank directory
repo (
Pygit2.Repository
) – the Pygit2 handleconfig (
MetaDict
) – when set, configuration file of the just-submitted archiverootree (
Pygit2.Object
) – When set, root handler to the next commit to insertlocked (bool) – Serialize Bank manipulation among multiple processes
proj_name (str) – extracted default-proj from initial token
- build_target_branch_name(tag: Optional[str] = None, hash: Optional[str] = None) str [source]
Compute the target branch to store data.
- This is used to build the exact Git branch name based on:
default-proj
unique profile hash, used to run the validation
- property default_project
- exists() bool [source]
Check if the bank is stored in
PATH_BANK
file.Verification is made either on name or path.
- Returns
True if both the bank exist and globally registered
- Return type
- load_config_from_file(path: str) None [source]
Load the configuration file associated with the archive to process.
- Parameters
path (str) – the configuration file path
- load_config_from_str(s: str) None [source]
Load the configuration data associated with the archive to process.
- Parameters
s (str) – the configuration data
- property name: str
Get bank name.
- Returns
the exact label (without default-project suffix)
- Return type
- name_exist() bool [source]
Check if the bank name is registered into
PATH_BANK
file.- Returns
True if the name (lowered) is in the keys()
- Return type
- path_exist() bool [source]
Check if the bank path is registered into
PATH_BANK
file.- Returns
True if the path is known.
- Return type
- property prefix: Optional[str]
Get path to bank directory.
- Returns
absolute path to directory
- Return type
- save_from_archive(tag: str, archivepath: str) None [source]
Extract results from the archive, if used to export results.
This is basically the same as
BanK.save_from_buildir()
except the archive is extracted first.
- pcvs.backend.bank.add_banklink(name: str, path: str) None [source]
Store a new bank to the global system.
- pcvs.backend.bank.flush_to_disk() None [source]
Update the
PATH_BANK
file with in-memory object.- Raises
IOError – Unable to properly manipulate the tree layout
- pcvs.backend.bank.init() None [source]
Bank interface detection.
Called when program initializes. Detects defined banks in
PATH_BANK