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=None, token='')[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=None, hash=None)[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: str
Get project set as default when none are provided.
- Returns:
the project name (as a Ref branch)
- Return type:
- exists()[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:
- get_count()[source]
Get the number of projects managed by this bank handle.
- Returns:
number of projects
- Return type:
- property name: str
Get bank name.
- Returns:
the exact label (without default-project suffix)
- Return type:
- name_exist()[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()[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, archivepath, msg=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.
- save_from_buildir(tag, buildpath, msg=None)[source]
Extract results from the given build directory & store into the bank.
- pcvs.backend.bank.init()[source]
Bank interface detection.
Called when program initializes. Detects defined banks in
PATH_BANK
- Return type: