From d18ddd92a7ea6a67ceb8cc70c552ae801a1c5389 Mon Sep 17 00:00:00 2001 From: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Date: Wed, 3 Mar 2021 16:23:27 -0500 Subject: [PATCH] align perf tests with js (#17069) --- .../azure-ai-textanalytics/tests/perfstress_tests/README.md | 2 +- .../tests/perfstress_tests/perf_detect_language.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/perfstress_tests/README.md b/sdk/textanalytics/azure-ai-textanalytics/tests/perfstress_tests/README.md index e50a4e4deb80..8e0294b4a237 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/perfstress_tests/README.md +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/perfstress_tests/README.md @@ -40,5 +40,5 @@ These options are available for all perf tests: ## Example command ```cmd -(env) ~/azure-ai-textanalytics/tests/perfstress_tests> perfstress DetectLanguagePerfStressTest +(env) ~/azure-ai-textanalytics/tests/perfstress_tests> perfstress DetectLanguagePerfStressTest --parallel=50 --warmup=1 ``` \ No newline at end of file diff --git a/sdk/textanalytics/azure-ai-textanalytics/tests/perfstress_tests/perf_detect_language.py b/sdk/textanalytics/azure-ai-textanalytics/tests/perfstress_tests/perf_detect_language.py index 15d2dc17dc06..9d4d7a8f9222 100644 --- a/sdk/textanalytics/azure-ai-textanalytics/tests/perfstress_tests/perf_detect_language.py +++ b/sdk/textanalytics/azure-ai-textanalytics/tests/perfstress_tests/perf_detect_language.py @@ -26,6 +26,7 @@ def __init__(self, arguments): endpoint=endpoint, credential=AzureKeyCredential(key), ) + self.input = ["Detta är ett dokument skrivet på engelska."] * 1000 async def close(self): """This is run after cleanup.""" @@ -35,8 +36,8 @@ async def close(self): def run_sync(self): """The synchronous perf test.""" - self.service_client.detect_language(["This is in English"]) + self.service_client.detect_language(self.input) async def run_async(self): """The asynchronous perf test.""" - await self.async_service_client.detect_language(["This is in English"]) + await self.async_service_client.detect_language(self.input)