From 4d1eb02ed5ee5d7af1b3cb2d6fc92842b2940ab2 Mon Sep 17 00:00:00 2001 From: Kashif Khan Date: Wed, 5 Apr 2023 10:15:38 -0500 Subject: [PATCH 1/2] fixes for perf bicep --- sdk/servicebus/perf-resources.bicep | 36 ++++++++++++----------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/sdk/servicebus/perf-resources.bicep b/sdk/servicebus/perf-resources.bicep index f8033a05b022..8dfbc728976b 100644 --- a/sdk/servicebus/perf-resources.bicep +++ b/sdk/servicebus/perf-resources.bicep @@ -2,11 +2,10 @@ param baseName string = resourceGroup().name param location string = resourceGroup().location var serviceBusNamespaceName = 'sb-${baseName}' -var serviceBusQueueName = 'sb-${baseName}-queue' -var serviceBusTopicName = 'sb-${baseName}-topic' -var serviceBusSubscriptionName = 'sb-${baseName}-subscription' +var serviceBusQueueName = '${serviceBusNamespaceName}-queue' +var serviceBusTopicName = '${serviceBusNamespaceName}-topic' +var serviceBusSubscriptionName = '${serviceBusNamespaceName}-subscription' var defaultSASKeyName = 'RootManageSharedAccessKey' -var authRuleResourceId = resourceId('Microsoft.ServiceBus/namespaces/authorizationRules', serviceBusNamespaceName, defaultSASKeyName) var sbVersion = '2017-04-01' @@ -21,10 +20,11 @@ resource serviceBusNamespace 'Microsoft.ServiceBus/namespaces@2017-04-01' = { } resource serviceBusQueue 'Microsoft.ServiceBus/namespaces/queues@2017-04-01' = { - name: '${serviceBusNamespaceName}/${serviceBusQueueName}' + parent: serviceBusNamespace + name: serviceBusQueueName properties: { lockDuration: 'PT5M' - maxSizeInMegabytes: 4096 + maxSizeInMegabytes: 1024 requiresDuplicateDetection: false requiresSession: false defaultMessageTimeToLive: 'P10675199DT2H48M5.4775807S' @@ -35,13 +35,11 @@ resource serviceBusQueue 'Microsoft.ServiceBus/namespaces/queues@2017-04-01' = { enablePartitioning: false enableExpress: false } - dependsOn: [ - serviceBusNamespace - ] } resource serviceBusTopic 'Microsoft.ServiceBus/namespaces/topics@2017-04-01' = { - name: '${serviceBusNamespaceName}/${serviceBusTopicName}' + parent: serviceBusNamespace + name: serviceBusTopicName properties: { autoDeleteOnIdle: 'P10675199DT2H48M5.4775807S' defaultMessageTimeToLive: 'P10675199DT2H48M5.4775807S' @@ -49,26 +47,22 @@ resource serviceBusTopic 'Microsoft.ServiceBus/namespaces/topics@2017-04-01' = { enableBatchedOperations: true enableExpress: false enablePartitioning: false - maxSizeInMegabytes: 4096 + maxSizeInMegabytes: 1024 requiresDuplicateDetection: false status: 'Active' supportOrdering: true } - dependsOn: [ - serviceBusNamespace - ] } -resource serviceBusNamespace_serviceBusTopicName_serviceBusSubscriptionName 'Microsoft.ServiceBus/namespaces/topics/subscriptions@2017-04-01' = { - name: '${serviceBusNamespaceName}/${serviceBusTopicName}/${serviceBusSubscriptionName}' +resource serviceBusSubscription 'Microsoft.ServiceBus/namespaces/topics/subscriptions@2017-04-01' = { + parent: serviceBusTopic + name: serviceBusSubscriptionName properties: { } - dependsOn: [ - serviceBusTopic - ] } - +var authRuleResourceId = resourceId('Microsoft.ServiceBus/namespaces/authorizationRules', serviceBusNamespace.name, defaultSASKeyName) output AZURE_SERVICEBUS_CONNECTION_STRING string = listkeys(authRuleResourceId, sbVersion).primaryConnectionString output AZURE_SERVICEBUS_QUEUE_NAME string = serviceBusQueue.name -output AZURE_TOPIC_QUEUE_NAME string = serviceBusTopic.name +output AZURE_SERVICEBUS_TOPIC_NAME string = serviceBusTopic.name +output AZURE_SERVICEBUS_SUBSCRIPTION_NAME string = serviceBusSubscription.name From c565e189e8dd7d9499fef654462496157296a67e Mon Sep 17 00:00:00 2001 From: Kashif Khan Date: Thu, 6 Apr 2023 08:11:10 -0500 Subject: [PATCH 2/2] fix env vars and params --- .../azure-servicebus/tests/perf_tests/_test_base.py | 4 ++-- sdk/servicebus/perf-resources.bicep | 4 ++-- sdk/servicebus/perf.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/servicebus/azure-servicebus/tests/perf_tests/_test_base.py b/sdk/servicebus/azure-servicebus/tests/perf_tests/_test_base.py index 7c69a9a3a654..a822c0e691a8 100644 --- a/sdk/servicebus/azure-servicebus/tests/perf_tests/_test_base.py +++ b/sdk/servicebus/azure-servicebus/tests/perf_tests/_test_base.py @@ -141,7 +141,7 @@ def __init__(self, arguments) -> None: arguments.uamqp_transport ) self.topic_name=self.get_from_env('AZURE_SERVICEBUS_TOPIC_NAME') - self.subscription_name=self.get_from_env('AZURE_SERVICE_BUS_SUBSCRIPTION_NAME') + self.subscription_name=self.get_from_env('AZURE_SERVICEBUS_SUBSCRIPTION_NAME') self.receiver=self.servicebus_client.get_subscription_receiver(topic_name=self.topic_name, subscription_name=self.subscription_name) self.async_receiver=self.async_servicebus_client.get_subscription_receiver(topic_name=self.topic_name, subscription_name=self.subscription_name) @@ -194,7 +194,7 @@ def __init__(self, arguments) -> None: ) self.topic_name=self.get_from_env('AZURE_SERVICEBUS_TOPIC_NAME') - self.subscription_name=self.get_from_env('AZURE_SERVICE_BUS_SUBSCRIPTION_NAME') + self.subscription_name=self.get_from_env('AZURE_SERVICEBUS_SUBSCRIPTION_NAME') self.receiver=self.servicebus_client.get_subscription_receiver(topic_name=self.topic_name, subscription_name=self.subscription_name) self.async_receiver=self.async_servicebus_client.get_subscription_receiver(topic_name=self.topic_name, subscription_name=self.subscription_name) diff --git a/sdk/servicebus/perf-resources.bicep b/sdk/servicebus/perf-resources.bicep index 8dfbc728976b..e17e1daef2ab 100644 --- a/sdk/servicebus/perf-resources.bicep +++ b/sdk/servicebus/perf-resources.bicep @@ -24,7 +24,7 @@ resource serviceBusQueue 'Microsoft.ServiceBus/namespaces/queues@2017-04-01' = { name: serviceBusQueueName properties: { lockDuration: 'PT5M' - maxSizeInMegabytes: 1024 + maxSizeInMegabytes: 4096 requiresDuplicateDetection: false requiresSession: false defaultMessageTimeToLive: 'P10675199DT2H48M5.4775807S' @@ -47,7 +47,7 @@ resource serviceBusTopic 'Microsoft.ServiceBus/namespaces/topics@2017-04-01' = { enableBatchedOperations: true enableExpress: false enablePartitioning: false - maxSizeInMegabytes: 1024 + maxSizeInMegabytes: 4096 requiresDuplicateDetection: false status: 'Active' supportOrdering: true diff --git a/sdk/servicebus/perf.yml b/sdk/servicebus/perf.yml index 53395794d37a..e02887e68ca9 100644 --- a/sdk/servicebus/perf.yml +++ b/sdk/servicebus/perf.yml @@ -14,7 +14,7 @@ parameters: - name: Arguments displayName: Arguments (regex of arguments to run) type: string - default: '(1024)' + default: '.*' - name: Iterations displayName: Iterations (times to run each test) type: number