* Stress test (#3820)
* mem leak fix
* PR comments fix
* PR comments
* seems to work?
* clang
* curl again
* add first stress test
* also update gitignore
* missing line
* only linux
* clang typo format
* typo 2
* PR comments
* cspell
* remove terminator
* Fixed the metadata for better handling (#3824)
Co-authored-by: sima-zhu <sizhu@microsoft.com>
* Update attestation core vcpkg dependency to latest GA version that is required. (#3830)
* Update attestation core vcpkg dependency to latest GA version that is required.
* Update vcpkg config.cmake to match the dependency version needed.
* Remove winhttp (#3832)
* remove refs to winhttp
* this tsst only curl
* Move perf.yml to eng/common (#3833)
Co-authored-by: Mike Harder <mharder@microsoft.com>
* Sync eng/common directory with azure-sdk-tools for PR 3656 (#3834)
* someone wants to reference the test-proxy startup scripts externally. to make this easy on them we're parameterizing the root of the eng/common for easy use in that scenario
* two leading $ signs on the definition of the certificate path was causing some issues!
Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
* Update casing for 'verison' (#3821)
Co-authored-by: Daniel Jurek <djurek@microsoft.com>
* Print additional result summary formats to pipelines UI (#3842)
Co-authored-by: Mike Harder <mharder@microsoft.com>
* Sync eng/common directory with azure-sdk-tools for PR 3702 (#3843)
* Add language-service to list of valid sample slugs
* Update link to taxonomies
Co-authored-by: Heath Stewart <heaths@microsoft.com>
* Fix incorrect failure notification in vcpkg publishing (#3838)
* Set up for testing of template pipeline
* Override branches, set up for template GA release
* More TODOs to prevent merging an unintended change
* More removal of TestPipeline
* Increment template version number
* Use script to set package version
* Check out the correct branch
* branch parameter in the command
* Use $(PublishToVcpkg) to determine if we should check for changes
* dictionary syntax
* Set GA package version to validate GA publish scenario
* Update changelog
* create-pull-request.yml optionally pushes changes
* Output GH PR URI
* Macro syntax with a variable set earlier
* Move up to 1.2.0-beta.2
* beta.1
* Revert changelog
* Revert testing-related changes
* Revert vcpkg-clone.yml
* Revert eng/common changes, ensure global $(HasChanges) is set properly
* Changes to enable testing
* 1.1.0-beta.1
* vcpkg clone should clone at configured branch
* Clone "main" branch of vcpkg betas
* Undo test-specific changes
* More PR cleanup
* PR cleanup
* Helm charts (#3841)
* helm chart
* first pipe setup
* poi
* magiks
* ewewe
* stress
* cleanup
* pr
* QFE and readme
* clang
* stupid clang , waste of time
* ewqwewewrqrewewrqewrqwrqr
* stupid clang
* cspell
* PR
* try try again
* clang again
* Sync eng/common directory with azure-sdk-tools for PR 3661 (#3846)
* Add full clone fallback to sparse checkout
* Improve clone handling and overrides for sparse checkout
* Use SkipSparseCheckout variable name
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
* Sync eng/common directory with azure-sdk-tools for PR 3735 (#3845)
* Detect API changes using new snadboxinx approach
* Added strictmode
* Remove unset variable
* Changes as per strict mode 3
* Rervert strict mode to allow language level fixes to merge first
Co-authored-by: praveenkuttappan <prmarott@microsoft.com>
* Increment version for keyvault releases (#3809)
* Increment package version after release of azure-security-keyvault-keys
* Increment package version after release of azure-security-keyvault-secrets
* Increment package version after release of azure-security-keyvault-certificates
* Removed hard dependency on opentelemetry version (#3844)
* Revert "Add full clone fallback to sparse checkout (#3661)" (#3851)
This reverts commit 7605ead00308dd20f20f2afe5acc4ec9900a2c47.
Co-authored-by: Ben Broderick Phillips <ben@benbp.net>
* Sync eng/common directory with azure-sdk-tools for PR 3753 (#3857)
* Bump MacOs version to macos-11
* Update eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1
Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
* Update eng/common/scripts/job-matrix/tests/job-matrix-functions.tests.ps1
Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
Co-authored-by: sima-zhu <sizhu@microsoft.com>
Co-authored-by: Sima Zhu <48036328+sima-zhu@users.noreply.github.com>
Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
* Bump macOs version to macos-11 (#3853)
* Update CHANGELOG.md
* Fix misleading step name in az module install (#3859)
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
* Retry poll calls on EINTR (#3858)
When signals are delievered to the process, calls here to poll may be
interrupted and return with a spurious failure. The call instead should be
restarted.
* Fix bad path to sample matrix json (#3860)
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
* Sync eng/common directory with azure-sdk-tools for PR 3826 (#3863)
* Add link checking for stress CI
* Remove region segment from stress testing links
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
* Core August releases (#3862)
* Core August releases
* cspell
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
* Increment version for core releases (#3865)
* Increment package version after release of azure-core
* Increment package version after release of azure-core-tracing-opentelemetry
* Storage Aug GA release (#3864)
* CG only runs on internal (#3866)
* Condition added and indentation changes
* STG 79 80 81 Features (#3850)
* Sync eng/common directory with azure-sdk-tools for PR 3860 (#3871)
* updating pfx and cert
* update the targeted version of the proxy as well
Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
* Storage August Preview Release (#3868)
* Storage August Preview Release
* update versions
* Increment version for storage releases (#3875)
* Increment package version after release of azure-storage-common
* Increment package version after release of azure-storage-blobs
* Fix an issue that reason phrase is missing as expected from HTTP/2 server (#3879)
* Fix an issue that reason phrase is missing as expected from HTTP/2 server
* reverse the condition
* compact comments
* fix clang format
* Update CODEOWNERS (#3881)
* updated targeted proxy version to one that properly allows consumption of TLS certificates (#3888)
Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
* Fix `azure-storage-blobs-cpp` beta install (#3889)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
* Fixed #3899 - Handle new OSX version correctly; reformatted platform-matrix JSON files (#3900)
* Simpler get-binarysizes check for OSX (#3901)
* Simpler get-binarysizes check for OSX
* Missed wildcard
* Sync eng/common directory with azure-sdk-tools for PR 3874 (#3907)
* Add sparse checkout to perf template
* Rename base template, add parameters
* Add comment
* Add TODO
* Fix copy/pase bug, add language to artifacts path
* Fix language ref
* Fix python language
* perf.yml extends perf-base.yml
* Remove unnecessary base yml
* Fetch pull request refs
* Fix refs path
* Fetch commitish if matches PR syntax
* Print command before running
* Add PR commitish to remote.origin.fetch
* Add pool and vmimage parameters
* Map ref under "refs/remotes/origin"
* Add ref to refs/remotes/origin
Co-authored-by: Mike Harder <mharder@microsoft.com>
* File Share Features until STG82 (#3908)
* Empty file or existing file won't be created/overwritten if the blob to be downloaded doesn't exist. (#3910)
* Remove unnecessary checkout: none that causes conflicts with sparse checkout declarations (#3915)
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
* Core September Release (#3913)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
* Increment package version after release of azure-core (#3919)
* Migrate SkipDefaultCheckout to SkipCheckoutNone (#3916)
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
* Storage Sept Release (#3914)
* Increment version for storage releases (#3924)
* Increment package version after release of azure-storage-common
* Increment package version after release of azure-storage-blobs
* Increment package version after release of azure-storage-files-shares
* Add github actions based check enforcer (#3922)
* Add `$schema` to `cgmanifest.json` (#3918)
Co-authored-by: Jamie Magee <jamie.magee@microsoft.com>
* Remove SkipDefaultCheckout parameter (#3930)
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
* Compatibility improvement for striped blob (#3932)
* add a parameter 'condition' to the test-proxy ci invocations. (#3931)
Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
* storage ad-hoc release (#3934)
* Increment package version after release of azure-storage-blobs (#3935)
* Update `AttestationClient::AttestTpm` API to match existing `AttestOpenEnclave` and `AttestSgxmEnclave` (#3928)
* Fix broken link and typo in contributing.md
* Use vector<uint8_t> for attest instead of strings
* remove options
* fix comments
* update release version
* remove versionig
* revert changelog
* add the change
* update comment
* Update sdk/attestation/azure-security-attestation/CHANGELOG.md
Co-authored-by: Larry Osterman <LarryOsterman@users.noreply.github.com>
* fix formatting
* address pr comment
* fix formating
* update a comment
* remove the attest tpm comment
Co-authored-by: Peng Li <pengfeli@microsoft.com>
Co-authored-by: Larry Osterman <LarryOsterman@users.noreply.github.com>
* Update check enforcer yaml permissions and name (#3944)
* Set VCPKG_ROOT (#3938)
* Set VCPKG_ROOT
* Update eng/pipelines/templates/steps/vcpkg-clone.yml
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
* Sync the devops helper scripts between azure-sdk repo and tools repo (#3949)
This should fix https://github.com/Azure/azure-sdk-tools/issues/3538
as it will now upgrade the devops extension to the latest version
which has the auth fix needed.
Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
* Add Win32FileTimeConverter (#3941)
* Sync eng/common directory with azure-sdk-tools for PR 4169 (#3950)
* pin newest version of proxy
Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
* Enable Query() test in blob SDK (#3960)
* Sync eng/common directory with azure-sdk-tools for PR 4212 (#3962)
* version including lock fixes
* target the correct proxy version
Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
* Pipeline core (#3953)
* test1
* glob
* quick cleanup
* ddasda
* ddsa
* envs
* dsds
* Revert "ddsa"
This reverts commit 6d9e385284ba37736fb5bc41e56065943abd7937.
* wq
* comment out issues
* valid test
* maybe
* qwewqewq
* lang steps
* Vcpkg pre-steps in the place Daniel should've recommend they go
* RepoOwner
* Correct repo owner name
* Remove vcpkg.yml (we don't need to write)
* PR trigger
* small change
* Update eng/pipelines/templates/jobs/perf.yml
Co-authored-by: Mike Harder <mharder@microsoft.com>
* Update eng/pipelines/templates/jobs/perf.yml
Co-authored-by: Mike Harder <mharder@microsoft.com>
* Update sdk/core/perf.yml
Co-authored-by: Mike Harder <mharder@microsoft.com>
Co-authored-by: Daniel Jurek <djurek@microsoft.com>
Co-authored-by: Mike Harder <mharder@microsoft.com>
* Win32FileTimeConverter (#3967)
* Sync eng/common directory with azure-sdk-tools for PR 4240 (#3965)
* use version of docker with CLI present
* target repaired executable
Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
* Revert "Add Win32FileTimeConverter (#3941)" (#3966)
This reverts commit
|
||
|---|---|---|
| .. | ||
| inc/azure | ||
| src | ||
| test | ||
| cgmanifest.json | ||
| CMakeLists.txt | ||
| NOTICE.txt | ||
| README.md | ||
Azure SDK Perf for C++
Azure perf for C++ (azure-perf) provides shared primitives, abstractions, and helpers for running performance tests for an Azure SDK clients for C++. It represent the C++ version of the .NET original version.
Getting started
See the pre-requisites for building before going to the next step.
Build
Use the build option BUILD_PERFORMANCE_TESTS to build the test framework and all the performance tests. See the next example.
#
# Building the Performance framework and tests.
#
git clone https://github.com/Azure/azure-sdk-for-cpp.git
cd azure-sdk-for-cpp
mkdir build
cd build
cmake -DBUILD_TESTING=ON -DBUILD_PERFORMANCE_TESTS=ON ..
cmake --build .
Run
Once building is completed, a performance test application will be created inside the the test folder from each service SDK. For instance, the Azure core performance test application would be inside: build/sdk/core/azure-core/test/perf. See next example for running the performance framework.
#
# Running the performance framework tests application
#
# From within the build folder (build)
./sdk/core/perf/test/azure-perf-test
Note: When building the code with Windows using Visual Studio, use the CMake project view to run the performance tests. Find the tests directly in the tests folder from the cmake tree next to all other test cmake projects.
Options for running
After running the performance test application like it is mentioned above (without any command line arguments) the application will list the available test names to be run. The application will expect the test name to be executed as a mandatory argument. If the input test name is not found, the application will return an error and will terminate. The next pattern represents the right usage of the performance test application:
usage: azure-perf-test testName [options]
Note: You can use the option
-hto print out the available options for a test name.
The next options can be used for any test:
| Option | Activators | Description | Default | Example |
|---|---|---|---|---|
| Duration | -d, --duration | Duration of the test in seconds | 10 | -d 5 |
| Host | --host | Host to redirect HTTP requests | NA | --host=https://something.com |
| Insecure | --insecure | Allow untrusted SSL certs | false | --insecure |
| Iterations | -i, --iterations | Number of iterations of main test loop | 1 | -d 5 |
| Statistics | --statistics | Print job statistics | false | --statistics=true |
| Latency | -l, --latency | Track and print per-operation latency statistics | false | -l true |
| No Clean | --noclean | Disables test clean up | false | --nocleanup=true |
| Parallel | -p, --parallel | Number of operations to execute in parallel | 1 | -p 5 |
| Port | --port | Port to redirect HTTP requests | NA | --port=5000 |
| Rate | -r, --rate | Target throughput (ops/sec) | NA | -r 3000 |
| Warm up | -w, --warmup | Duration of warmup in seconds | 5 | -w 0 (no warm up) |
Creating a perf test
Find below how to create a new CMake performance test project from scratch to an existing CMake project. Then how to add the performance tests to it.
The CMake project
The main CMake project represents the definition of the main performance test application. It defines the name of the binary to be produced and the libraries to be linked to it. The recommended folder where this project should be is inside the test folder from a service package (i.e. sdk/core/azure-core/test/performance).
Follow the next template to create the main CMake project
# Copyright (c) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: MIT
# Configure CMake project.
cmake_minimum_required (VERSION 3.13)
project(provide-a-project-name-here LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Name the binary to be created.
add_executable (
azure-performance-library-name-test
src/main.cpp
)
# Include the headers from the project.
target_include_directories(
azure-performance-library-name-test
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
)
# link the `azure-perf` lib together with any other library which will be used for the tests. Below example is using azure-core only.
target_link_libraries(azure-performance-library-name-test PRIVATE azure-core azure-perf)
# Make sure the project will appear in the test folder for Visual Studio CMake view
set_target_properties(azure-performance-library-name-test PROPERTIES FOLDER "Tests")
Notes:
- Create the
srcandincfolders.- Add a
main.cppfile to thesrcfolder.
The main.cpp
The main source file defines the list of available tests and calls the performance framework Run function. Take a loop to the next example.
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
// The performance framework headers
#include <azure/perf/options.hpp>
#include <azure/perf/program.hpp>
// The test definition headers
#include "azure/perf/test/extended_options.hpp"
#include "azure/perf/test/no_op_test.hpp"
// The utilities
#include <functional>
#include <iostream>
#include <map>
int main(int argc, char** argv)
{
/**
* The test list is a dictionary with the name of the test as a key and
* an std::function to define how to instantiate a new Test for the PerfTest
* interface.
*
* In the next example, a map called `tests` is init with two test definitions.
*
**/
std::map<
std::string,
std::function<std::unique_ptr<Azure::Perf::PerfTest>(
Azure::Perf::TestOptions)>>
tests{
{"noOp", // Test Name
[](Azure::Perf::TestOptions options) {
// No Op test
return std::make_unique<Azure::Perf::Test::NoOp>(options);
}},
{"extendedOptions", // Test Name
[](Azure::Perf::TestOptions options) {
// Extended options test
return std::make_unique<Azure::Perf::Test::ExtendedOptionsTest>(options);
}}};
// Call the `Run` method with a context, the tests and the application arguments to launch the program.
Azure::Perf::Program::Run(Azure::Core::Context::ApplicationContext, tests, argc, argv);
return 0;
}
The Run method from the performance framework will parse the command line arguments to find out the test name to be run. Then it will try to get that test name from the tests map. If the test is found, the framework will get any extra options defined in the test and parse it from the command line arguments. Then it uses the std::function to create a as many instances of the test as the parallel option value.
In the above code example, the two tests added to the map are defined in the project headers. Each test is defined in its own header. See below example for how to define a test.
Create a performance test
The next code example illustrates how to define a very simple empty test.
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
/**
* @file
* @brief Define an empty test.
*
*/
#pragma once
// The performance framework headers
#include <azure/perf/options.hpp>
#include <azure/perf/test.hpp>
// Use a namespace according to the service package
namespace Azure { namespace Perf { namespace Test {
// Define a derived class from a PerfTest
class NoOp : public Azure::Perf::PerfTest {
public:
// Define a constructor to take TestOptions and use the options for the
// PerfTest constructor.
NoOp(Azure::Perf::TestOptions options) : PerfTest(options) {}
// Override the `Run` method with the test definition
void Run(Azure::Core::Context const& ctx) override {
(void)ctx;
}
};
}}} // namespace Azure::Perf::Test
Create a performance test with options
A test can define its own options as an addition to the base options from the performance framework. See the next example to learn how to do it.
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
/**
* @file
* @brief An example of a performance test that defines a test option.
*
*/
#pragma once
// The performance framework headers
#include <azure/perf/options.hpp>
#include <azure/perf/test.hpp>
#include <azure/perf/test_options.hpp>
// Utilities
#include <vector>
namespace Azure { namespace Perf { namespace Test {
// The test class definition and constructor looks just the same as any
// other test (with or without extended options).
class ExtendedOptionsTest : public Azure::Perf::PerfTest {
public:
ExtendedOptionsTest(Azure::Perf::TestOptions options) : PerfTest(options) {}
// Override the `GetTestOptions` function to define the unique test options.
// Do not duplicate activators or test names or the application will fail during parsing.
std::vector<Azure::Perf::TestOption> GetTestOptions() override
{
// Each test option is define by 4 properties:
// - Name (string)
// - Activators (array of strings which must starts with `-` or `--`)
// - Description (string that will be use for the help message on console)
// - Expected Arguments (int to define how many arguments are expected after the activator)
return {{"extraOption", {"-e"}, "Example for extended option for test.", 1}};
}
// Use the `m_options.GetOptionsOrDefault` function inside the test definition to get
// the test options.
void Run(Azure::Core::Context const& ctx) override
{
// Get a defined test option.
auto myTestOption = m_options.GetOptionOrDefault("extraOption", 0);
(void)ctx;
(void)myTestOption;
}
};
}}} // namespace Azure::Perf::Test
Contributing
For details on contributing to this repository, see the [contributing guide][azure_sdk_for_cpp_contributing].
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Additional Helpful Links for Contributors
Many people all over the world have helped make this project better. You'll want to check out:
- What are some good first issues for new contributors to the repo?
- [How to build and test your change][azure_sdk_for_cpp_contributing_developer_guide]
- [How you can make a change happen!][azure_sdk_for_cpp_contributing_pull_requests]
- Frequently Asked Questions (FAQ) and Conceptual Topics in the detailed Azure SDK for C++ wiki.
Reporting security issues and security bugs
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) secure@microsoft.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.
License
Azure SDK for C++ is licensed under the MIT license.