Stress test (#4268)

* stressTest

* STRESS WORKS

* missing space
This commit is contained in:
George Arama 2023-01-24 15:43:54 -08:00 committed by GitHub
parent dd58487030
commit e5812ec72c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 71 additions and 25 deletions

View File

@ -0,0 +1,9 @@
Dockerfile
*.go
*.bat
*.txt
*.ps1
*.cpp
*.md
azure-core-libcurl-stress-test
[Bb]in/

View File

@ -15,5 +15,5 @@ add_executable(
target_link_libraries(azure-core-libcurl-stress-test PRIVATE azure-core)
create_map_file(azure-core-libcurl-stress-test azure-core-libcurl-stress-test.map)
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/Dockerfile
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
file(COPY ${CMAKE_CURRENT_BINARY_DIR}
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin)

View File

@ -4,7 +4,7 @@
apiVersion: v2
name: libcurl-stress-test
description: An example of c++ stress test
version: 0.0.1
version: 0.0.2
appVersion: v0.1
annotations:
stressTest: 'true' # enable auto-discovery of this test via `find-all-stress-packages.ps1`
@ -12,5 +12,5 @@ annotations:
dependencies:
- name: stress-test-addons
version: 0.1.19
version: ~0.2.0
repository: https://stresstestcharts.blob.core.windows.net/helm/

View File

@ -3,12 +3,9 @@
FROM mcr.microsoft.com/mirror/docker/library/ubuntu:22.04
ARG targetTest
ARG build
# copy the tagrget binary
ADD $targetTest ./$targetTest
RUN chmod +x ./$targetTest
COPY ./bin/libcurl-stress-test/azure-core-libcurl-stress-test ./azure-core-libcurl-stress-test
RUN chmod +x ./azure-core-libcurl-stress-test
# install the mem check tool
RUN apt-get update -y

View File

@ -0,0 +1,2 @@
Set-Location $PSScriptRoot
pwsh "../../../../../eng/common/scripts/stress-testing/deploy-stress-tests.ps1" -Login -PushImages

View File

@ -0,0 +1,8 @@
scenarios:
- image: Dockerfile
Scenario: cpp-constantDetach
imageBuildDir: ./
memory: 1.5Gi
testTarget: azure-core-libcurl-stress-test
imageTag: stresspgs7b6dif73rup6.azurecr.io/gearama/libcurl-stress-test/dockerfile:gearama

View File

@ -44,11 +44,11 @@ void SendRequest(std::string target)
void Operation(int repetitions)
{
std::string base = "https://xyz.";
std::string base = "https://bing.com.";
for (int i = 0; i < repetitions; i++)
{
std::cout << i << std::endl;
SendRequest(base + std::to_string(i) + ".abc");
SendRequest(base); // + std::to_string(i) + ".abc");
}
}

View File

@ -0,0 +1,16 @@
displayNames:
# this makes it so these don't show up in the scenario names,
# since they're just clutter.
1.5Gi": ""
4Gi": ""
image: ""
matrix:
images:
cpp:
image: Dockerfile
imageBuildDir: "./"
scenarios:
constantDetach:
testTarget: azure-core-libcurl-stress-test
memory: "1.5Gi"

View File

@ -1,16 +1,27 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
//
// Dummy parameter to handle defaults the script passes in
param testApplicationOid string = ''
@description('The base resource name.')
param baseName string = resourceGroup().name
resource config 'Microsoft.AppConfiguration/configurationStores@2020-07-01-preview' = {
name: 'config-${resourceGroup().name}'
location: resourceGroup().location
@description('The client OID to grant access to test resources.')
param testApplicationOid string
var apiVersion = '2017-04-01'
// Uncomment this if you want to test against the southeastasia nodes.
//var location = 'southeastasia'
var location = resourceGroup().location
var authorizationRuleName_var = '${baseName}/RootManageSharedAccessKey'
var authorizationRuleNameNoManage_var = '${baseName}/NoManage'
var serviceBusDataOwnerRoleId = '/subscriptions/${subscription().subscriptionId}/providers/Microsoft.Authorization/roleDefinitions/090c5cfd-751d-490a-894a-3ce6f1109419'
resource servicebus 'Microsoft.ServiceBus/namespaces@2018-01-01-preview' = {
name: baseName
location: location
sku: {
name: 'Standard'
tier: 'Standard'
}
properties: {
zoneRedundant: false
}
}
output RESOURCE_GROUP string = resourceGroup().name
output AZURE_CLIENT_OID string = testApplicationOid
output QUEUE_NAME_WITH_SESSIONS string = 'testQueueWithSessions'

View File

@ -4,12 +4,11 @@
{{- define "stress.deploy-example" -}}
metadata:
labels:
testName: "libcurl-stress-test"
name: "libcurl-stress-test"
chaos: "{{ default false .Stress.chaos }}"
spec:
containers:
- name: libcurl-stress-test
image: stresspgs7b6dif73rup6.azurecr.io/azuresdkforcpp/curlstress:latest
- name: main
image: {{ .Stress.imageTag }}
imagePullPolicy: Always
command:
[
@ -19,4 +18,8 @@ spec:
"./azure-core-libcurl-stress-test",
]
{{- include "stress-test-addons.container-env" . | nindent 6 }}
resources:
limits:
memory: {{.Stress.memory }}
cpu: "1"
{{- end -}}