ocs_ci.utility.perf_dash package

Submodules

ocs_ci.utility.perf_dash.dashboard_api module

API module to interact with the Performance Dashboard In order to push results into the dashboard, and pulling data from it to compare between results.

The DB structure is :

some tables which use for indexing values and all in the same structure:

versions : list of all OCS versions which tested platform : list of tested platform (e.g. AWS / VSphere etc.) az_topology : Topology of the tested environment (e.g. 3-AZ) tests : Tests name which ran (e.g. FIO / SmallFiles etc.)

table name :

ID (int) : the index - unique number Name (str) : the name to index

the builds table contain the builds of a particular OCS version

table namebuilds

ID (int) : the index - unique number version (int) : version ID - must be exists in the versions table Name (str) : the name (or number) of the build (e.g. 254 / RC1-312 / GA)

the results table contain the complete data about individual test

table nameresults

ID (int): the index - unique number sample (int): number of the sample - each test can be run more the one time version (int): version ID - must be exists in the versions table build (int): build ID - must be exists in the builds table platform (int): platform ID - must be exists in the platform table az_topology (int): topology ID - must be exists in the az_topology table test_name (int): test ID - must be exists in the tests table es_link (str): the elasticsearch links to the individual test separated by comma e.g. http://<es_server>:<port>/<sub-test_1>, http://<es_server>:<port>/<sub-test_2> log_file (str): link to full test log

One single test test (e.g. FIO) can be split to few sub-tests (by parametrize), e.g. : [CEPHBLOCKPOOL, sequential], [CEPHFILESYSTEM, sequential], [CEPHBLOCKPOOL, random], [CEPHFILESYSTEM, random]

but in the dashboard all those tests (4 in the FIO example) are displayed as single test

class ocs_ci.utility.perf_dash.dashboard_api.PerfDash

Bases: object

The API class to connect and managing the performance dashboard database

add_results(version, build, platform, topology, test, eslink, logfile)

Adding results information into the DB.

Parameters:
  • version (str) – The version number (e.g. 4.9.0)

  • build (str) – The build number (e.g. RC5-180)

  • platform (str) – The platform (e.g. Bare-Metal)

  • topology (str) – The topology (e.g. 3-AZ)

  • test (str) – The test name (e.g. SmallFiles)

  • eslink (str) – The elasticsearch link(s) to the results

  • logfile (str) – The link to the test log file

Returns:

True if the operation succeed otherwise False

Return type:

bool

cleanup()

Cleanup and close the DB connection

connect()

Create DB connection

Raises:

in case of connection failed - use the exception that caught

get_build_id(version, build)

Getting the build ID for specific build of version. if the build does not exist, return None

Parameters:
  • version (str) – the version name (e.g. 4.9.0)

  • build (str) – the build name (e.g. GA)

Returns:

the build ID

Return type:

int

get_id_by_name(table=None, name=None)

Query the ID of specific ‘name’ value from selected table

Parameters:
  • table (str) – The table from which data will be query

  • name (str) – The value for the ‘name’ field in the table to query

Returns:

the value of the ID field in the table, otherwise None

Return type:

int

get_name_by_id(table=None, recid=None)

Query the name of specific ‘id’ value from selected table

Parameters:
  • table (str) – The table from which data will be query

  • recid (int) – The value for the ‘id’ field in the table to query

Returns:

the value of the Name field in the table, otherwise None

Return type:

str

get_next_sample(version, build, platform, topology, test)

Getting the the number of the next sample for particular test results. if there are no results in the DB, it will return 0

Parameters:
  • version (str) – The version number (e.g. 4.9.0)

  • build (str) – The build number (e.g. RC5-180)

  • platform (str) – The platform (e.g. Bare-Metal)

  • topology (str) – The topology (e.g. 3-AZ)

  • test (str) – The test name (e.g. SmallFiles)

Returns:

the number of the next sample to insert to the DB

Return type:

int

get_platform_id(platform=None)

Query of the ID of platform name in the DB

Parameters:

platform (str) – The platform name (e.g. AWS)

Returns:

the Platform ID in the DB

Return type:

int

get_platform_name(platform=0)

Query of the IName of platform ID in the DB

Parameters:

platform (int) – The platform ID

Returns:

the Platform Name in the DB

Return type:

str

get_results(version, build, platform, topology, test)

Getting the results information (es_link, log_file) for all test samples for a particular test configuration.

Parameters:
  • version (str) – The version number (e.g. 4.9.0)

  • build (str) – The build number (e.g. RC5-180)

  • platform (str) – The platform (e.g. Bare-Metal)

  • topology (str) – The topology (e.g. 3-AZ)

  • test (str) – The test name (e.g. SmallFiles)

Returns:

dictionary of all test samples as :

{sample: {es_link, log_file},}

Return type:

dict

get_test_id(test=None)

Query of the ID of test name in the DB

Parameters:

test (str) – The test name (e.g. FIO)

Returns:

the Test ID in the DB

Return type:

int

get_test_name(test=0)

Query of the Name of test ID in the DB

Parameters:

test (int) – The test ID

Returns:

the Test Name in the DB

Return type:

str

get_topology_id(topology=None)

Query of the ID of platform name in the DB

Parameters:

topology (str) – The Topology name (e.g. 3-AZ)

Returns:

the Topology ID in the DB

Return type:

int

get_topology_name(topology=0)

Query of the Name of platform ID in the DB

Parameters:

topology (int) – The Topology ID

Returns:

the Topology Name in the DB

Return type:

str

get_version_builds(version=None)

Query the list of build in specific version

Parameters:

version (str) – The version name (e.g. 4.9.0)

Returns:

dictionary of (Name: ID), None if not exist

Return type:

dict

get_version_id(version=None)

Query of the ID of version number in the DB

Parameters:

version (str) – The version number (e.g. 4.9.0)

Returns:

the version ID in the DB

Return type:

int

get_version_name(version=0)

Query of the Name of version ID in the DB

Parameters:

version (int) – The version ID

Returns:

the version name in the DB

Return type:

str

insert_build(version, build)

Insert a new build to the DB and return it’s ID

Parameters:
  • version (str) – The version number as string (e.g. 4.9.0)

  • build (str) – The build number (e.g. 180 / RC1-200 / GA)

Returns:

the ID of the build in the DB, otherwise None

Return type:

int

insert_single_value(table=None, value=None)

Insert a value to ‘table’ and return it’s ID

Parameters:
  • table (str) – The table to insert data into

  • value (str) – The value to insert

Returns:

the ID of the value in the table, otherwise None

Return type:

int

Module contents