loadero_python.resources.result module

Loadero result resource.

Result resource is seperated into three parts

ResultParams class describes result attributes

ResultAPI group all API operations for result resource

Result class combines ResultParams and ResultAPI

Single result object coresponds to single result in Loadero.

class loadero_python.resources.result.ArtifactInfoParams[source]

Bases: LoaderoResourceParams

ArtifactInfoParams describes Loadero artifact resources.

property error: str | None

Artifact error message.

Returns:

str: Artifact error message.

property paths: list[URL] | None

URLs of artifact files.

Returns:

list[URL]: URLs of artifact files.

class loadero_python.resources.result.ArtifactsInfoParams[source]

Bases: LoaderoResourceParams

ArtifactsInfoParams describes Loadero artifacts of a single test run.

property audio: ArtifactInfoParams

Audio artifacts.

Returns:

ArtifactInfoParams: Audio artifacts.

property downloads: ArtifactInfoParams

Downloads artifacts.

Returns:

ArtifactInfoParams: Downloads artifacts.

property screenshots: ArtifactInfoParams

Screenshots artifacts.

Returns:

ArtifactInfoParams: Screenshots artifacts.

property video: ArtifactInfoParams

Video artifacts.

Returns:

ArtifactInfoParams: Video artifacts.

class loadero_python.resources.result.DataSyncParams[source]

Bases: LoaderoResourceParams

DataSyncParams groups all datasync results result.

property result_timecards: list[ResultTimecardParams]

List of timecards created duding test.

Returns:

list[ResultTimecardParams]: List of timecards created duding test.

class loadero_python.resources.result.MeanOpinionScoresParams[source]

Bases: LoaderoResourceParams

MeanOpinionScoresParams groups all MOS evaluations results.

property visqol: list[ResultMOSParams]

Mean opinion scores calculated using Visqol algorithm.

Returns:

list[ResultMOSParams]: Mean opinion scores calculated using Visqol algorithm.

class loadero_python.resources.result.MetricParams[source]

Bases: LoaderoResourceParams

MetricParams describes single result metric of a Loadero test run.

property average: float

Average value of all data points of metric.

Returns:

float: Average value of all data points of metric.

property created: datetime

Time when metric was created.

Returns:

datetime: Time when metric was created.

property data_count: int

Number of data points of metric.

Returns:

int: Number of data points of metric.

property maximum: float

Maximum value of all data points of metric.

Returns:

float: Maximum value of all data points of metric.

property metric_id: int

Metric id.

Returns:

int: Metric id.

property metric_path: MetricBasePath

Metric base path of metric.

Returns:

MetricBasePath: Metric base path of metric.

property minimum: float

Minimum value of all data points of metric.

Returns:

float: Minimum value of all data points of metric.

property perc_1st: float

1st percentile of all data points of metric.

Returns:

float: 1st percentile of all data points of metric.

property perc_25th: float

25th percentile of all data points of metric.

Returns:

float: 25th percentile of all data points of metric.

property perc_50th: float

50th percentile of all data points of metric.

Returns:

float: 50th percentile of all data points of metric.

property perc_5th: float

5th percentile of all data points of metric.

Returns:

float: 5th percentile of all data points of metric.

property perc_75th: float

75th percentile of all data points of metric.

Returns:

float: 75th percentile of all data points of metric.

property perc_95th: float

95th percentile of all data points of metric.

Returns:

float: 95th percentile of all data points of metric.

property perc_99th: float

99th percentile of all data points of metric.

Returns:

float: 99th percentile of all data points of metric.

property rstddev: float

Relative standard deviation of all data points of metric.

Returns:

float: Relative standard deviation of all data points of metric.

property stddev: float

Standard deviation of all data points of metric.

Returns:

float: Standard deviation of all data points of metric.

property total: float

Total value of all data points of metric.

Returns:

float: Total value of all data points of metric.

property value: str

Value of metric.

Returns:

str: Value of metric.

class loadero_python.resources.result.MetricsParams[source]

Bases: LoaderoResourceParams

MetricsParams groups all result metrics of a Loadero test run.

property machine: dict[MetricBasePath, MetricParams]

Machine metrics.

Returns:

dict[MetricBasePath, MetricParams]: Machine metrics.

property webrtc: dict[MetricBasePath, MetricParams]

Webrtc metrics.

Returns:

dict[MetricBasePath, MetricParams]: Webrtc metrics.

class loadero_python.resources.result.Result(run_id: int | None = None, result_id: int | None = None, params: ResultParams | None = None)[source]

Bases: LoaderoResource

Result class allows to perform read operation of Loadero result resource.

APIClient must be previously initialized with a valid Loadero access token.

The target Loadero result resource is determined by ResultParams.

read() Result[source]

Reads a existing result.

Required attributes of params field that need to be populated, otherwise the method will raise an exception:

  • result_id

  • run_id

Raises:

ValueError: If resource params do not sufficiently identify resource.

APIException: If API call fails.

Returns:

Result: Read result resource.

class loadero_python.resources.result.ResultAPI[source]

Bases: object

ResultAPI defines Loadero API operations for result resources.

static read(params: ResultParams) ResultParams[source]

Read an existing result resource.

Args:

params (ResultParams): Describes the result resource to read.

Raises:

ValueError: If resource params do not sufficiently identify resource.

APIException: If API call fails.

Returns:

ResultParams: Read Result resource params.

static read_all(run_id: int, query_params: QueryParams | None = None) PagedResponse[source]

Read all result resources for run.

Args:

run_id (int): Parent run resource id.

query_params (QueryParams, optional): Describes query parameters.

Raises:

APIException: If API call fails.

Returns:

PagedResponse: Paged response of result resources.

static route(run_id: int, result_id: int | None = None) str[source]

Build result url route.

Args:

run_id (int): Run resource id.

result_id (int, optional): Result resource id. Defaults to None. If omitted, the route will point to all result resources of parent run resource.

Returns:

str: Route to result resource/s.

class loadero_python.resources.result.ResultAssertParams[source]

Bases: LoaderoResourceParams

ResultAssert describes Loadero result assert resource attributes.

property actual: str

Actual value of result assert.

Returns:

str: Actual value.

property created: datetime

Time when result assert was created.

Returns:

datetime: Time when result assert was created.

property expected: str

Expected value of result assert.

Returns:

str: Expected value.

property message: str

Result assert message.

Returns:

str: Result assert message.

property operator: Operator

Operator of result assert.

Returns:

Operator: Operator.

property path: MetricPath

Metric pats of result assert.

Returns:

MetricPath: Metric path.

property result_assert_id: int

Result assert id.

Returns:

int: Result assert id.

property result_id: int

Result id that the result assert belongs to.

Returns:

int: Result id.

property run_assert_id: int

Run assert id that the result assert belongs to.

Returns:

int: Run assert id.

property status: AssertStatus

Result assert status.

Returns:

AssertStatus: Result assert status.

class loadero_python.resources.result.ResultFilterKey(value)[source]

Bases: FilterKey

ResultFilterKey is an enum of all filter keys for result read all API operation.

AUDIO_FEED = 'filter_audio_feed'
BROWSER = 'filter_browser'
END_FROM = 'filter_end_from'
END_TO = 'filter_end_to'
GROUP_NAME = 'filter_group_name'
GROUP_NUM_FROM = 'filter_group_num_from'
GROUP_NUM_TO = 'filter_group_num_to'
LOCATION = 'filter_location'
MOS_STATUS = 'filter_mos_status'
NAME = 'filter_name'
NETWORK = 'filter_network'
NUM_FROM = 'filter_num_from'
NUM_TO = 'filter_num_to'
RECORD_AUDIO = 'filter_record_audio'
SELENIUM_RESULT = 'filter_selenium_result'
START_FROM = 'filter_start_from'
START_TO = 'filter_start_to'
STATUS = 'filter_status'
VIDEO_FEED = 'filter_video_feed'
class loadero_python.resources.result.ResultLogParams[source]

Bases: LoaderoResourceParams

ResultLogParams describes Loadero result log resource attributes.

property allure_report: URL

Allure report URL.

Returns:

str: Allure report URL.

property browser: URL

Browser log URL.

Returns:

str: Browser log URL.

property created: datetime

Time when result log was created.

Returns:

datetime: Time when result log was created.

property result_id: int

Result id that the result log belongs to.

Returns:

int: Result id.

property result_log_id: int

Result log id.

Returns:

int: Result log id.

property rru: URL

Result resource usage log URL.

Returns:

str: Result resource usage log URL.

property selenium: URL

Selenium log URL.

Returns:

str: Selenium log URL.

property webrtc: URL

WebRTC log URL.

Returns:

URL: WebRTC log URL.

class loadero_python.resources.result.ResultMOSParams[source]

Bases: LoaderoResourceParams

ResultMOSParams describes a single MOS result.

property algorithm: MosAlgorithm

Algorithm used to calculate MOS.

Returns:

MosAlgorithm: Algorithm used to calculate MOS.

property created: datetime

Time when mos result was created.

Returns:

datetime: Time when mos result was created.

property end: datetime

End time of audio fragment.

Returns:

datetime: End time of audio fragment.

property result_id: int

Result id that the mos result belongs to.

Returns:

int: Result id that the mos result belongs to.

property result_mos_id: int

Result MOS ID.

Returns:

int: Result MOS ID.

property score: str

Mean opinion score.

Returns:

str: Mean opinion score.

property start: datetime

Start time of audio fragment.

Returns:

datetime: Start time of audio fragment.

class loadero_python.resources.result.ResultParams(result_id: int | None = None, run_id: int | None = None)[source]

Bases: LoaderoResourceParams

ResultParams represents Loadero result resource attributes.

property artifacts: ArtifactsInfoParams

Artifacts created by participant.

Returns:

ArtifactsInfoParams: Artifacts created by participant.

property asserts: list[ResultAssertParams]

Assert results for participant.

Returns:

list[ResultAssertParams]: Assert results for participant.

property created: datetime

Time when result was created.

Returns:

datetime: Time when result was created.

property data_sync: DataSyncParams

Data collected with datasync wy participant.

Returns:

DataSyncParams: Data collected with datasync wy participant.

property end: datetime

Test particpiant execution end time.

Returns:

datetime: Test particpiant execution end time.

property log_paths: ResultLogParams

Log paths.

Returns:

ResultLogParams: Log paths.

property metrics: MetricsParams

Metrics results of participant.

Returns:

MetricsParams: Metrics results of participant.

property mos: MeanOpinionScoresParams

Mean opinion score results of participant.

Returns:

MeanOpinionScoresParams: Mean opinion score results of participant.

property mos_status: MetricStatus

Mean opinion score calculation status.

Returns:

MetricStatus: Mean opinion score calculation status.

property participant_details: RunParticipantParams

Participant details.

Returns:

RunParticipantParams: Participant details.

property selenium_result: ResultStatus

Test script execution result of particpiant.

Returns:

ResultStatus: Test script execution result of particpiant.

property start: datetime

Test particpiant execution start time.

Returns:

datetime: Test particpiant execution start time.

property status: ResultStatus

Test particpiant execution status.

Returns:

ResultStatus: Test particpiant execution status.

property updated: datetime

Time when result was last updated.

Returns:

datetime: Time when result was last updated.

class loadero_python.resources.result.ResultTimecardParams[source]

Bases: LoaderoResourceParams

ResultTimecardParams describes a single timecard result.

property created: datetime

Time when result timecard was created.

Returns:

datetime: Time when result timecard was created.

property end: int

End time of timecard as Unix timestamp in milliseconds.

Returns:

int: End time of timecard as Unix timestamp in milliseconds.

property name: str

Name of the timecard.

Returns:

str: Name of the timecard.

property result_id: int

Result id that the timecard result belongs to.

Returns:

int: Result id that the timecard result belongs to.

property result_timecard_id: int

Result timecard ID.

Returns:

int: Result timecard ID.

property start: int

Start time of timecard as Unix timestamp in milliseconds.

Returns:

int: Start time of timecard as Unix timestamp in milliseconds.