Skip to content

azure-developer-loadtesting v1.0.0b2 #25550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 219 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
219 commits
Select commit Hold shift + click to select a range
507ae4d
SDK generated autorest
Yashikaj14 Jun 6, 2022
9b6061c
upload function added
Yashikaj14 Jun 6, 2022
74eb518
patch.py changed
Yashikaj14 Jun 8, 2022
2d8eafd
upload updated
Yashikaj14 Jun 8, 2022
33c26d6
whl file removed
Yashikaj14 Jun 9, 2022
a91c728
whls deleted
Yashikaj14 Jun 9, 2022
9af9160
aio updated
Yashikaj14 Jun 9, 2022
081fd12
spell check added
Yashikaj14 Jun 9, 2022
fb9cb76
spell check
Yashikaj14 Jun 11, 2022
11d1531
Update shared_requirements.txt
msyyc Jun 13, 2022
2be648f
Merge branch 'main' into loadtestservice
msyyc Jun 13, 2022
1d98c14
Update MANIFEST.in
Yashikaj14 Jun 13, 2022
6881429
Update setup.py
Yashikaj14 Jun 13, 2022
b42ef95
spell added
Yashikaj14 Jun 13, 2022
3dea6da
Merge branch 'loadtestservice' of https://github.com/Yashikaj14/azure…
Yashikaj14 Jun 13, 2022
0d1dbf3
patch.py updated
Yashikaj14 Jun 13, 2022
07abc8e
linting corrected
Yashikaj14 Jun 14, 2022
e43a9fb
Update allowed_pylint_failures.py
msyyc Jun 14, 2022
4e2c523
readme updated
Yashikaj14 Jun 14, 2022
5e87691
Merge branch 'loadtestservice' of https://github.com/Yashikaj14/azure…
Yashikaj14 Jun 14, 2022
7a6a769
patch.py updation
Yashikaj14 Jun 14, 2022
10fe0aa
Update _patch.py
Yashikaj14 Jun 15, 2022
5ac02da
tests added
Yashikaj14 Jun 15, 2022
806badd
Merge branch 'loadtestservice' of https://github.com/Yashikaj14/azure…
Yashikaj14 Jun 15, 2022
3e3b655
async naming
Yashikaj14 Jun 15, 2022
015cf2e
test and result
BigCat20196 Jun 15, 2022
1204f67
fix
BigCat20196 Jun 15, 2022
8e27ba7
push the test result
BigCat20196 Jun 15, 2022
d577901
fix
Yashikaj14 Jun 15, 2022
5e08cc1
readme updated
Yashikaj14 Jun 15, 2022
df3e5b1
fix
Yashikaj14 Jun 15, 2022
b95aa58
tests added and async built
Yashikaj14 Jun 15, 2022
ed84eb0
yaml added
Yashikaj14 Jun 15, 2022
5959144
yaml updated
Yashikaj14 Jun 15, 2022
8703e03
sample and readme updated
Yashikaj14 Jun 16, 2022
0b6b1a5
fix ci.yml
Yashikaj14 Jun 16, 2022
592718d
Merge branch 'main' into loadtestservice
msyyc Jun 20, 2022
deb0b9c
more tests and samples addded and readme updated
Yashikaj14 Jun 20, 2022
6c6110e
Merge branch 'loadtestservice' of https://github.com/Yashikaj14/azure…
Yashikaj14 Jun 20, 2022
2028ca3
tests
Yashikaj14 Jun 21, 2022
742cc82
fix
Yashikaj14 Jun 21, 2022
62eb9f1
fix2
Yashikaj14 Jun 21, 2022
ea5e975
type added
Yashikaj14 Jun 28, 2022
3edb300
type added
Yashikaj14 Jun 28, 2022
e8b0cff
Update CHANGELOG.md
msyyc Jul 5, 2022
85a7208
chnaged to developer
Jul 15, 2022
d1d4d9e
Merge branch 'Azure:main' into yashika-loadtestservice
Jul 15, 2022
4047427
renamed package
Jul 15, 2022
08b2b8a
chnaged ci files
Jul 15, 2022
2649f5c
linting fixes
Jul 15, 2022
c1696e7
changed namespace from analytics to developer
Jul 17, 2022
6d18d56
Merge branch 'Azure:main' into yashika-loadtestservice
Jul 18, 2022
b341212
app_component naming cleaned
Jul 18, 2022
b49be9b
folded get_app_component
Jul 18, 2022
2cd4310
various name changes and added type hinting
Jul 18, 2022
277b22d
lint changes
Jul 18, 2022
29b3cb1
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Jul 18, 2022
ff45aee
added wrapper for LoadTestClient
Jul 18, 2022
70ddd05
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Jul 19, 2022
3f39ea4
removed msrest dependencies
Jul 19, 2022
05e96ef
corrected Serializer method
Jul 19, 2022
08e481a
test_smoke fixed
Jul 19, 2022
be1061f
fixes in aio class
Jul 19, 2022
80e09ca
updates samples
Jul 19, 2022
f68724d
namespace chg AppComponent, serverMetrics, test
Jul 19, 2022
a384829
updated samples
Jul 19, 2022
50cfcf0
namespace changes done
Jul 20, 2022
c8563b0
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Jul 20, 2022
58e4964
LoadTestClient -> LoadTestingClient
Jul 20, 2022
924ccc7
apnd load_test to test_run & adminstration
Jul 20, 2022
37abf4e
added Readme Descirption
Jul 20, 2022
714f5e7
few changes in tests
Jul 20, 2022
9ffe28b
moved SUBSCRIPTION_ID to .env
Jul 20, 2022
d2254d7
resloved readme issues by @iscai-msft in #24744
Jul 20, 2022
568cc65
resolved #discussion_r925248158
Jul 20, 2022
deced9b
resolving other issue by @iscai-msft #24744
Jul 20, 2022
f29ccdd
#25264#discussion_r925284462
Jul 20, 2022
7dc92f0
cleaned tests
Jul 20, 2022
2207eae
Merge remote-tracking branch 'origin/main'
Jul 21, 2022
26758c4
namechanges
Jul 21, 2022
b4c17c9
resolved folding issues
Jul 21, 2022
78cadd6
Merge branch 'Azure:main' into main
Jul 21, 2022
e6aa88a
fixing dependencies verison
Jul 21, 2022
f8f7cf1
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Jul 21, 2022
573bf9e
Merge branch 'main' of https://github.com/NiveditJain/azure-sdk-for-p…
Jul 21, 2022
e1e1153
added tests for _patch(es)
Jul 21, 2022
e053006
removed subs id from recordings
Jul 21, 2022
e723a75
fixing isodate requirements
Jul 21, 2022
4c398d9
removed SaaS key from smoke test
Jul 21, 2022
4a6d627
folder name chnage + setup.py cleaned
Jul 22, 2022
d989897
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Jul 22, 2022
faddc05
Readme changes suggested by @msyyc
Jul 22, 2022
c558817
added dependencies in shared_requirements.txt
Jul 22, 2022
fe9a681
removed os.environ from tests
Jul 22, 2022
3307408
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Jul 22, 2022
eac412d
liniting
Jul 22, 2022
ce66a8a
removed async test
Jul 22, 2022
cf979da
fixing tests
Jul 22, 2022
f44a41b
ci fix try
Jul 22, 2022
2e6b81f
trying dev_tools
Jul 22, 2022
f3039cb
fix for azure-mgmt-loadtestservice dev_reqs
scbedd Jul 22, 2022
bbdef79
Merge branch 'main' into main
Jul 25, 2022
7743fb3
added async tests
Jul 25, 2022
c26cd14
some tests
Jul 25, 2022
20e0cc2
cleaned setup
Jul 25, 2022
a162887
fixing async tests
Jul 25, 2022
7b66a7f
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Jul 25, 2022
0c9ff64
added mgmt to loadtestservice to ci
Jul 25, 2022
a4564ac
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Jul 26, 2022
919e95f
changed fie mode from json to BinaryIO
Jul 26, 2022
2cc19b9
reverting merge by @BigCat20196
Jul 26, 2022
e509d21
removed TEST_ID
Jul 26, 2022
d39dc05
Merge branch 'Azure:main' into main
Jul 27, 2022
e1e6b5d
solving issues by @lmazuel
Jul 27, 2022
1ef6f32
update with autorest6.1.0 and update tests
BigCat20196 Jul 27, 2022
3819643
update and format
BigCat20196 Jul 27, 2022
ea024ac
fix playback failed
BigCat20196 Jul 27, 2022
5ae8a12
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Jul 27, 2022
59dfeb8
Merge branch 'main' of https://github.com/NiveditJain/azure-sdk-for-p…
Jul 27, 2022
0493ca9
Update test_smoke.test_create_or_update_test_run.yaml
msyyc Jul 27, 2022
1c9c4e2
Update test_smoke.test_smoke_create_or_update_test.yaml
msyyc Jul 27, 2022
9c2de2f
Update test_smoke_async.test_smoke_create_or_update_test.yaml
msyyc Jul 27, 2022
084f491
updated README
Jul 27, 2022
23d98fe
Merge branch 'main' of https://github.com/NiveditJain/azure-sdk-for-p…
Jul 27, 2022
032e780
Merge branches 'main' and 'main' of https://github.com/Azure/azure-sd…
Jul 27, 2022
884c6ac
Merge branch 'main' into main
Jul 28, 2022
4f5a9a1
Merge branch 'main' into main
Jul 29, 2022
0f09b8b
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Aug 1, 2022
c36b7af
Merge branch 'main' of https://github.com/NiveditJain/azure-sdk-for-p…
Aug 1, 2022
762769a
test case of app components create
Aug 1, 2022
49f57d8
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Aug 1, 2022
5debf99
delete_app_components fixed
Aug 1, 2022
7717079
complete testing for AppComponent Class
Aug 1, 2022
96748c7
tested create_or_update_test
Aug 1, 2022
fc3a656
client.load_test_administration.delete_load_test
Aug 1, 2022
a13c954
tests for get_load_test
Aug 1, 2022
21f9c86
tested upload_test_file
Aug 2, 2022
2fa19b6
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Aug 2, 2022
c28d4ea
complete TestOperations testing
Aug 2, 2022
e504295
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Aug 2, 2022
2ebd61a
removed sas keys from recordings
Aug 2, 2022
a02817a
corrected name error
Aug 2, 2022
0f03e79
corrected sample and added tests for test_run(1/2)
Aug 2, 2022
3e4b128
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Aug 2, 2022
f56d557
TestRun testing done
Aug 2, 2022
1cbd0f8
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Aug 2, 2022
56107c9
completed ServerMetrics testing
Aug 2, 2022
eb8535e
remove SAS key from files
Aug 2, 2022
8a6b9b7
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Aug 2, 2022
7b48215
removing SAS key
Aug 2, 2022
b3aceb7
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Aug 3, 2022
0c6d8b2
Update README.md
ninallam Aug 3, 2022
87fdd7b
Update README.md
ninallam Aug 3, 2022
b4cb415
Update README.md
ninallam Aug 3, 2022
1b1f2ef
Update README.md
ninallam Aug 3, 2022
26c396c
Merge pull request #2 from ninallam/patch-1
Aug 3, 2022
51e2c15
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Aug 3, 2022
14beef5
Merge branch 'main' of https://github.com/NiveditJain/azure-sdk-for-p…
Aug 3, 2022
a4e161a
some work in tests
Aug 3, 2022
d1a0548
cleaned samples as per @ninallam
Aug 4, 2022
e78ba87
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Aug 4, 2022
a246b9c
updated CHANGELOG.md
Aug 4, 2022
33e5d44
updated CHANGELOG.md
Aug 4, 2022
f373f4a
trying to fix chnagelog CI
Aug 4, 2022
e8361db
migrate tests to testproxy
BigCat20196 Aug 4, 2022
5ab28e0
added changes suggested by @ninallam & @msyyc
Aug 5, 2022
639dd45
Merge branch 'main' of https://github.com/NiveditJain/azure-sdk-for-p…
Aug 5, 2022
9fc4d54
updated change log
Aug 5, 2022
5867cb6
Update README.md
ninallam Aug 5, 2022
2f48a63
Merge pull request #3 from ninallam/patch-2
Aug 5, 2022
7ce0018
fixed issues with sample
Aug 5, 2022
dd8bd0f
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Aug 5, 2022
45e0871
Merge branch 'main' of https://github.com/NiveditJain/azure-sdk-for-p…
Aug 5, 2022
c986d44
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Aug 8, 2022
3862403
fix playback failed
BigCat20196 Aug 8, 2022
f422914
Merge branch 'main' of https://github.com/NiveditJain/azure-sdk-for-p…
BigCat20196 Aug 8, 2022
2cd01db
Update sdk/loadtestservice/azure-developer-loadtesting/CHANGELOG.md
msyyc Aug 9, 2022
ffbdec9
Update CHANGELOG.md
msyyc Aug 9, 2022
d11f049
fix playback failed
BigCat20196 Aug 9, 2022
21084ae
Fix changelog
msyyc Aug 9, 2022
0e44b0b
Update _version.py
msyyc Aug 9, 2022
74fe31e
Update CHANGELOG.md
msyyc Sep 12, 2022
1e05392
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python
Sep 21, 2022
2868001
added bug explanation in Readme file.
Sep 21, 2022
2895e98
added bug explanation in Readme file.
Sep 21, 2022
d1c38b2
removed samples and test cases from Changelog
Sep 21, 2022
455425b
added resource creation example in samples for mgmt plane
Sep 21, 2022
f45320d
fixed sample resource creation link
Sep 21, 2022
301508d
adding ref to DefaultAzureCredential
Sep 21, 2022
519238b
refactor mgmt sample file
Sep 21, 2022
11005db
broken samples into files
Sep 21, 2022
91cda2c
fixed samples as disucssed with @iscai-msft
Sep 23, 2022
f6a5fdb
added few access to reult dict
Sep 23, 2022
5815ab6
update tests and recordings
BigCat20196 Sep 26, 2022
3c9ecba
Update README.md
msyyc Sep 26, 2022
48f1a56
fixed typo, matrics -> metrics
Sep 26, 2022
0480338
fixed typo, matrics -> metrics
Sep 26, 2022
17f1c6f
update test recording
BigCat20196 Sep 27, 2022
da602ea
rename non test files
BigCat20196 Sep 27, 2022
3de6e15
improved samples as per @ninallam
Sep 27, 2022
066435a
simplified check validation in SDK
Sep 29, 2022
6622722
resolved comments by @iscai-msft
Oct 4, 2022
a894dde
pushing new design for validation checking
Oct 5, 2022
a3309d7
minor changes
Oct 5, 2022
1131101
removed LRO operations
Oct 7, 2022
944527e
minor fixes
Oct 7, 2022
5c4e9f7
started async tests
Oct 9, 2022
2c6fd2b
pushing more tests
Oct 9, 2022
42494ac
completed corresponding async tests
Oct 9, 2022
c756819
removed mgmt plane samples
Oct 10, 2022
4f826e3
fixing broken link
Oct 10, 2022
a0c54e9
ran black
Oct 12, 2022
f3b77d2
chnaged security scope
Oct 13, 2022
19aa796
Update CHANGELOG.md
msyyc Oct 17, 2022
3865d37
Update conftest.py
msyyc Oct 17, 2022
87534c2
updated README
Oct 17, 2022
fcc6ea4
Merge branch 'main' of https://github.com/NiveditJain/azure-sdk-for-p…
Oct 17, 2022
b42b79e
added troubleshooting section
Oct 17, 2022
a8d56fe
minor fixes
Oct 17, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Release History

## 1.0.0b2 (2022-10-17)

### Bug Fixed
- `delete_app_components` method from `azure.developer.loadtesting.LoadTestingClient.load_test_administration.delete_app_components` was not discoverable in expected location, fixed discoverability.

### Other Changes
- Updated README

## 1.0.0b1 (2022-07-28)

### Features Added
- Initial version
140 changes: 90 additions & 50 deletions sdk/loadtestservice/azure-developer-loadtesting/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@

# Azure Developer LoadTesting client library for Python
Azure Developer LoadTesting provides client library in python to the user by which they can interact natively with Load Test Service.The service is for performing the load test to optimize application performance, scalability or capacity. The user can get the client-side and server-side metrices to see the details reported by the test engine and information about your Azure application components.
# Azure Load Testing client library for Python
Azure Load Testing provides client library in python to the user by which they can interact natively with Azure Load Testing service. Azure Load Testing is a fully managed load-testing service that enables you to generate high-scale load. The service simulates traffic for your applications, regardless of where they're hosted. Developers, testers, and quality assurance (QA) engineers can use it to optimize application performance, scalability, or capacity.

## Documentation
Various documentation is available to help you get started

<!-- - [Source code][source_code] -->
- [API reference documentation][api_reference_doc]
- [Product Documentation][product_documentation]

## Getting started

### Installating the package
### Installing the package

```bash
python -m pip install azure-developer-loadtesting
Expand All @@ -16,26 +22,90 @@ python -m pip install azure-developer-loadtesting
- Python 3.7 or later is required to use this package.
- You need an [Azure subscription][azure_sub] to use this package.
- An existing Azure Developer LoadTesting instance.

#### Create with an Azure Active Directory Credential

To use an [Azure Active Directory (AAD) token credential][authenticate_with_token],
provide an instance of the desired credential type obtained from the
[azure-identity][azure_identity_credentials] library.

To authenticate with AAD, you must first [pip][pip] install [`azure-identity`][azure_identity_pip]

After setup, you can choose which type of [credential][azure_identity_credentials] from azure.identity to use.
As an example, [DefaultAzureCredential][default_azure_credential] can be used to authenticate the client:

Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`
As an example, sign in via the Azure CLI `az login` command and [DefaultAzureCredential](https://learn.microsoft.com/python/api/azure-identity/azure.identity.defaultazurecredential?view=azure-python) will authenticate as that user.

Use the returned token credential to authenticate the client.

Use the returned token credential to authenticate the client:
#### Create the client

The data plane URI should be provided as the endpoint to create the client.

```python
from azure.developer.loadtesting import LoadTestingClient

# for managing authentication and authorization
# can be installed from pypi, follow: https://pypi.org/project/azure-identity/
# using DefaultAzureCredentials, read more at: https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.defaultazurecredential?view=azure-python
from azure.identity import DefaultAzureCredential

client = LoadTestingClient(endpoint='<endpoint>', credential=DefaultAzureCredential())
```
## Key concepts

The following components make up te Azure Load Testing service. The Azure Load Test client library for python allows you to interact with each of these components through the use of clients. There are two top-level clients which are the main entry points for the library

- `LoadTestingClient` (`azure.developer.loadtesting.LoadTestingClient`)

- Async `LoadTestingClient` (`azure.developer.loadtesting.aio.LoadTestingClient`)

The two clients have similar methods in them except the methods in the async client are async as well.

The top-level clients have two sub-clients

- `load_test_runs` (`azure.developer.loadtesting.LoadTestingClient.load_test_runs`)

- `load_test_administration` (`azure.developer.loadtesting.LoadTestingClient.load_test_administration`)

These sub-clients are used for managing and using different components of the service.

### Load Test Administration Client

The `load_test_administration` sub-clients is used to administer and configure the load tests, app components and metrics.

#### Test

A test specifies the test script, and configuration settings for running a load test. You can create one or more tests in an Azure Load Testing resource.

#### App Component

When you run a load test for an Azure-hosted application, you can monitor resource metrics for the different Azure application components (server-side metrics). While the load test runs, and after completion of the test, you can monitor and analyze the resource metrics in the Azure Load Testing dashboard.

#### Metrics

During a load test, Azure Load Testing collects metrics about the test execution. There are two types of metrics:

1. Client-side metrics give you details reported by the test engine. These metrics include the number of virtual users, the request response time, the number of failed requests, or the number of requests per second.

2. Server-side metrics are available for Azure-hosted applications and provide information about your Azure application components. Metrics can be for the number of database reads, the type of HTTP responses, or container resource consumption.

### Test Run Client

The `load_test_runs` sub-clients is used to start and stop test runs corresponding to a load test. A test run represents one execution of a load test. It collects the logs associated with running the Apache JMeter script, the load test YAML configuration, the list of app components to monitor, and the results of the test.

### Data-Plane Endpoint

Data-plane of Azure Load Testing resources is addressable using the following URL format:

`00000000-0000-0000-0000-000000000000.aaa.cnt-prod.loadtesting.azure.com`

The first GUID `00000000-0000-0000-0000-000000000000` is the unique identifier used for accessing the Azure Load Testing resource. This is followed by `aaa` which is the Azure region of the resource.

The data-plane endpoint is obtained from Control Plane APIs.

**Example:** `1234abcd-12ab-12ab-12ab-123456abcdef.eus.cnt-prod.loadtesting.azure.com`

In the above example, `eus` represents the Azure region `East US`.

## Examples

Expand All @@ -46,7 +116,7 @@ from azure.identity import DefaultAzureCredential
from azure.core.exceptions import HttpResponseError

TEST_ID = "some-test-id"
DISPLAY_NAME = "new_namespace-new-namespace"
DISPLAY_NAME = "my-load-test"
SUBSCRIPTION_ID = os.environ["SUBSCRIPTION_ID"]

client = LoadTestingClient(endpoint='<endpoint>', credential=DefaultAzureCredential())
Expand All @@ -55,24 +125,20 @@ try:
result = client.load_test_administration.create_or_update_test(
TEST_ID,
{
"resourceId": f"/subscriptions/{SUBSCRIPTION_ID}/resourceGroups/yashika-rg/providers/Microsoft.LoadTestService/loadtests/loadtestsdk",
"description": "",
"displayName": DISPLAY_NAME,
"loadTestConfig": {
"engineSize": "m",
"engineInstances": 1,
"splitAllCSVs": False,
},
"secrets": {},
"environmentVariables": {},
"passFailCriteria": {"passFailMetrics": {}},
"keyvaultReferenceIdentityType": "SystemAssigned",
"keyvaultReferenceIdentityId": None,
"passFailCriteria": {"passFailMetrics": {}}
},
)
print(result)
except HttpResponseError as e:
print('service responds error: {}'.format(e.response.json()))
print('Service responded with error: {}'.format(e.response.json()))

```

Expand All @@ -92,7 +158,7 @@ try:
result = client.load_test_administration.upload_test_file(TEST_ID, FILE_ID, open("sample.jmx", "rb"))
print(result)
except HttpResponseError as e:
print("Failed to send JSON message: {}".format(e.response.json()))
print("Failed with error: {}".format(e.response.json()))
```

### Running a Test
Expand All @@ -103,57 +169,26 @@ from azure.core.exceptions import HttpResponseError

TEST_ID = "some-test-id"
TEST_RUN_ID = "some-testrun-id"
DISPLAY_NAME = "new_namespace-new-namespace"
DISPLAY_NAME = "my-load-test-run"

client = LoadTestingClient(endpoint='<endpoint>', credential=DefaultAzureCredential())

try:
result = client.load_test_runs.create_and_update_test(
result = client.load_test_runs.create_or_update_test(
TEST_RUN_ID,
{
"testId": TEST_ID,
"displayName": DISPLAY_NAME,
"requestSamplers": [],
"errors": [],
"percentiles": ["90"],
"groupByInterval": "5s",
},
)
print(result)
except HttpResponseError as e:
print("Failed to send JSON message: {}".format(e.response.json()))
print("Failed with error: {}".format(e.response.json()))
```
## Key concepts
The following components make up the Azure Load Testing Service. The Azure Load Test client library for Python allows you to interact with each of these components through the use of a dedicated client object.

### Load testing resource
The Load testing resource is the top-level resource for your load-testing activities. This resource provides a centralized place to view and manage load tests, test results, and related artifacts. A load testing resource contains zero or more load tests.

### Test
A test specifies the test script, and configuration settings for running a load test. You can create one or more tests in an Azure Load Testing resource.

### Test Engine
A test engine is computing infrastructure that runs the Apache JMeter test script. You can scale out your load test by configuring the number of test engines. The test script runs in parallel across the specified number of test engines.

### Test Run
A test run represents one execution of a load test. It collects the logs associated with running the Apache JMeter script, the load test YAML configuration, the list of app components to monitor, and the results of the test.

### App Component
When you run a load test for an Azure-hosted application, you can monitor resource metrics for the different Azure application components (server-side metrics). While the load test runs, and after completion of the test, you can monitor and analyze the resource metrics in the Azure Load Testing dashboard.

### Metrics
During a load test, Azure Load Testing collects metrics about the test execution. There are two types of metrics:

1. Client-side metrics give you details reported by the test engine. These metrics include the number of virtual users, the request response time, the number of failed requests, or the number of requests per second.

2. Server-side metrics are available for Azure-hosted applications and provide information about your Azure application components. Metrics can be for the number of database reads, the type of HTTP responses, or container resource consumption.

## Troubleshooting
More about it is coming soon...

## Next steps

More examples are coming soon...
More samples can be found [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/loadtestservice/azure-developer-loadtesting/samples).

## Contributing

Expand All @@ -172,6 +207,9 @@ This project has adopted the
see the Code of Conduct FAQ or contact [email protected] with any
additional questions or comments.

## Troubleshooting
More about it is coming soon...

<!-- LINKS -->
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token
Expand All @@ -180,3 +218,5 @@ additional questions or comments.
[default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential
[pip]: https://pypi.org/project/pip/
[azure_sub]: https://azure.microsoft.com/free/
[api_reference_doc]: https://docs.microsoft.com/rest/api/loadtesting/
[product_documentation]: https://azure.microsoft.com/services/load-testing/
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any)
self.endpoint = endpoint
self.credential = credential
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://loadtest.azure-dev.com/.default"])
self.credential_scopes = kwargs.pop("credential_scopes", ["https://cnt-prod.loadtesting.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "developer-loadtesting/{}".format(VERSION))
self._configure(**kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0b1"
VERSION = "1.0.0b2"
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs:
self.endpoint = endpoint
self.credential = credential
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://loadtest.azure-dev.com/.default"])
self.credential_scopes = kwargs.pop("credential_scopes", ["https://cnt-prod.loadtesting.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "developer-loadtesting/{}".format(VERSION))
self._configure(**kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""

from typing import Any, IO, Optional, Union, cast, overload, List, MutableMapping, Coroutine, BinaryIO

from typing import Any, IO, Optional, Union, cast, overload, List, MutableMapping, Coroutine, BinaryIO, Awaitable
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
Expand Down Expand Up @@ -95,14 +93,14 @@ class AppComponentOperations:
def __init__(self, *args, **kwargs):
self.__app_component_operations_generated = AppComponentOperationsGenerated(*args, **kwargs)

def get_app_components(
async def get_app_components(
self,
*,
test_run_id: Optional[str] = None,
test_id: Optional[str] = None,
name: Optional[str] = None,
**kwargs: Any,
) -> Coroutine[Any, Any, MutableMapping[str, Any]]:
) -> MutableMapping[str, Any]:
"""Get App Components for a test or a test run by its name.

Get App Components for a test or a test run by its name.
Expand Down Expand Up @@ -150,14 +148,14 @@ def get_app_components(
"""

if name is not None:
return self.__app_component_operations_generated.get_app_component_by_name(name=name, **kwargs)
return await self.__app_component_operations_generated.get_app_component_by_name(name=name, **kwargs)
else:
return self.__app_component_operations_generated.get_app_component(
return await self.__app_component_operations_generated.get_app_component(
test_run_id=test_run_id, test_id=test_id, **kwargs
)

@overload
def create_or_update_app_components(
async def create_or_update_app_components(
self, name: str, body: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any
) -> JSON:
"""Associate an App Component (Azure resource) to a test or test run.
Expand Down Expand Up @@ -233,7 +231,7 @@ def create_or_update_app_components(
"""

@overload
def create_or_update_app_components(
async def create_or_update_app_components(
self, name: str, body: IO, *, content_type: str = "application/merge-patch+json", **kwargs: Any
) -> JSON:
"""Associate an App Component (Azure resource) to a test or test run.
Expand Down Expand Up @@ -283,7 +281,9 @@ def create_or_update_app_components(
"""

@distributed_trace
def create_or_update_app_components(self, name: str, body: Union[JSON, IO], **kwargs: Any) -> JSON:
async def create_or_update_app_components(
self, name: str, body: Union[JSON, IO], **kwargs: Any
) -> MutableMapping[str, Any]:
"""Associate an App Component (Azure resource) to a test or test run.

Associate an App Component (Azure resource) to a test or test run.
Expand Down Expand Up @@ -329,25 +329,25 @@ def create_or_update_app_components(self, name: str, body: Union[JSON, IO], **kw
}
}
"""
return self.__app_component_operations_generated.create_or_update_app_components(name, body, **kwargs)
return await self.__app_component_operations_generated.create_or_update_app_components(name, body, **kwargs)

@distributed_trace
def delete_app_components( # pylint: disable=inconsistent-return-statements
self, name: str, **kwargs: Any
) -> None:
"""Delete an App Component.
@distributed_trace
async def delete_app_components( # pylint: disable=inconsistent-return-statements
self, name: str, **kwargs: Any
) -> None:
"""Delete an App Component.

Delete an App Component.
Delete an App Component.

:param name: Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$.
Required.
:type name: str
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
:param name: Unique name of the App Component, must be a valid URL character ^[a-z0-9_-]*$.
Required.
:type name: str
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""

return self.__app_component_operations_generated.delete_app_components(name, **kwargs)
return await self.__app_component_operations_generated.delete_app_components(name, **kwargs)


__all__: List[str] = ["TestOperations", "AppComponentOperations"]
Expand Down
Loading