probeload

load_test_result_field_should_be

Reads a load test result and compares the field’s value to be equal to the expected given value.

Activity as code

Below are the details and signature of the activity Python module.

Typeprobe
Modulechaosreliably.activities.load.probes
Nameload_test_result_field_should_be
Returnboolean

Usage

JSON

{
  "name": "load-test-result-field-should-be",
  "type": "probe",
  "provider": {
    "type": "python",
    "module": "chaosreliably.activities.load.probes",
    "func": "load_test_result_field_should_be",
    "arguments": {
      "result_filepath": "",
      "field": "",
      "expect": 0
    }
  }
}

YAML

name: load-test-result-field-should-be
provider:
  arguments:
    expect: 0
    field: ""
    result_filepath: ""
  func: load_test_result_field_should_be
  module: chaosreliably.activities.load.probes
  type: python
type: probe

Arguments

NameTypeDefaultRequiredTitleDescription
result_filepathstring/tmp/results.jsonYesResult File PathPath to a local file that was created via the inject_gradual_traffic_into_endpoint action
fieldstringnum_failuresYesFieldFiel name, of the result file, to read a value from
expectinteger0YesExpected ValueValue expected in the results
result_item_namestring/NoEndpoint PathWhen several path were recorded during the load tests, use the field to select the path you want to verify
pass_if_file_is_missingbooleantrueNoAllow Missing Result FileAct as if succeeded when file is missing

Reads a load test result and compares the field’s value to less than the expected given value.

If the load test runs against many endpoint, specify which one must be validated by setting the result_item_name to match the name field.

Signature

def load_test_result_field_should_be(
        result_filepath: str,
        field: str,
        expect: int,
        result_item_name: Optional[str] = None,
        pass_if_file_is_missing: bool = True) -> bool:
    pass