From babdd49fba5093214b15712e6df807c813fad227 Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Wed, 8 Feb 2023 07:48:33 +0000 Subject: [PATCH 01/33] set profiling arguments --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 3 +++ .../perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs | 1 + 2 files changed, 4 insertions(+) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index 1c7d24a98c4..e409defd107 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -140,6 +140,9 @@ public override async Task RunAsync( var projectDirectory = Path.Combine(WorkingDirectory, project); + if(profile){ + arguments = arguments + "--profile true"; + } var testResult = await Util.RunAsync("npm", $"run perf-test:node -- {testName} {arguments}", projectDirectory, outputBuilder: outputBuilder, errorBuilder: errorBuilder, throwOnError: false); diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs index 0f1f5d021f3..24b54179beb 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs @@ -236,6 +236,7 @@ private static async Task Run(RunOptions options) // all profiling data for a performance run by that language. // Later this directory will be zipped to create ZIP file that can be retained with the name "{language name}-profile.zip". string profileDirectory = Path.Combine(Program.Config.WorkingDirectories[language], language + "-profile"); + Console.WriteLine("profileDirectory = ",profileDirectory); if (!Directory.Exists(profileDirectory)) { profileDirectories.Add(Directory.CreateDirectory(profileDirectory)); From e7f411807e0488ef028d1b1d8910b994890cebde Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Wed, 8 Feb 2023 08:15:24 +0000 Subject: [PATCH 02/33] add a space --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index e409defd107..41effb5d402 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -141,7 +141,7 @@ public override async Task RunAsync( var projectDirectory = Path.Combine(WorkingDirectory, project); if(profile){ - arguments = arguments + "--profile true"; + arguments = arguments + " --profile true"; } var testResult = await Util.RunAsync("npm", $"run perf-test:node -- {testName} {arguments}", projectDirectory, outputBuilder: outputBuilder, errorBuilder: errorBuilder, throwOnError: false); From 30798a42efc6a06a82636e403284039e0e92b847 Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Wed, 8 Feb 2023 17:44:17 +0000 Subject: [PATCH 03/33] testing --- .../perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs index 24b54179beb..85c0690c828 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs @@ -236,7 +236,9 @@ private static async Task Run(RunOptions options) // all profiling data for a performance run by that language. // Later this directory will be zipped to create ZIP file that can be retained with the name "{language name}-profile.zip". string profileDirectory = Path.Combine(Program.Config.WorkingDirectories[language], language + "-profile"); - Console.WriteLine("profileDirectory = ",profileDirectory); + Console.WriteLine("profileDirectory start "); + Console.WriteLine(profileDirectory); + Console.WriteLine("profileDirectory end "); if (!Directory.Exists(profileDirectory)) { profileDirectories.Add(Directory.CreateDirectory(profileDirectory)); From 163f303b0c66c8776ab10c4ca9a05885fcbd4bf0 Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Wed, 8 Feb 2023 18:06:22 +0000 Subject: [PATCH 04/33] more testing --- .../perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs index 85c0690c828..fd3e986088a 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs @@ -238,6 +238,9 @@ private static async Task Run(RunOptions options) string profileDirectory = Path.Combine(Program.Config.WorkingDirectories[language], language + "-profile"); Console.WriteLine("profileDirectory start "); Console.WriteLine(profileDirectory); + Console.WriteLine(profileDirectory.FullName); + Console.WriteLine(profileDirectory.Name); + Console.WriteLine(Path.Combine(profileDirectory.Parent.FullName, profileDirectory.Name + ".zip") Console.WriteLine("profileDirectory end "); if (!Directory.Exists(profileDirectory)) { From 247676cf44e72384e7172c5516c901ef94fc457c Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Wed, 8 Feb 2023 18:21:17 +0000 Subject: [PATCH 05/33] formatting --- tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs index fd3e986088a..a9f36292200 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs @@ -240,7 +240,7 @@ private static async Task Run(RunOptions options) Console.WriteLine(profileDirectory); Console.WriteLine(profileDirectory.FullName); Console.WriteLine(profileDirectory.Name); - Console.WriteLine(Path.Combine(profileDirectory.Parent.FullName, profileDirectory.Name + ".zip") + Console.WriteLine(Path.Combine(profileDirectory.Parent.FullName, profileDirectory.Name + ".zip")); Console.WriteLine("profileDirectory end "); if (!Directory.Exists(profileDirectory)) { From 4045cc31b274ff9a7eb671da34e274e1fb04c5e4 Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Wed, 8 Feb 2023 18:44:01 +0000 Subject: [PATCH 06/33] remove logs --- .../perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs index a9f36292200..85c0690c828 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs @@ -238,9 +238,6 @@ private static async Task Run(RunOptions options) string profileDirectory = Path.Combine(Program.Config.WorkingDirectories[language], language + "-profile"); Console.WriteLine("profileDirectory start "); Console.WriteLine(profileDirectory); - Console.WriteLine(profileDirectory.FullName); - Console.WriteLine(profileDirectory.Name); - Console.WriteLine(Path.Combine(profileDirectory.Parent.FullName, profileDirectory.Name + ".zip")); Console.WriteLine("profileDirectory end "); if (!Directory.Exists(profileDirectory)) { From aa0699a5c2902d340ec0b250eddb4522a460517d Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Wed, 8 Feb 2023 18:47:51 +0000 Subject: [PATCH 07/33] serviceLanguageInfo.Project testing --- tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs index 85c0690c828..d0664e1546a 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs @@ -238,6 +238,7 @@ private static async Task Run(RunOptions options) string profileDirectory = Path.Combine(Program.Config.WorkingDirectories[language], language + "-profile"); Console.WriteLine("profileDirectory start "); Console.WriteLine(profileDirectory); + Console.WriteLine(serviceLanguageInfo.Project); Console.WriteLine("profileDirectory end "); if (!Directory.Exists(profileDirectory)) { From 8ed8fd6c30699d3bc3803b183ab5a7ca6c58062b Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Wed, 8 Feb 2023 19:10:37 +0000 Subject: [PATCH 08/33] remove console.logs --- .../perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs index d0664e1546a..0f1f5d021f3 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs @@ -236,10 +236,6 @@ private static async Task Run(RunOptions options) // all profiling data for a performance run by that language. // Later this directory will be zipped to create ZIP file that can be retained with the name "{language name}-profile.zip". string profileDirectory = Path.Combine(Program.Config.WorkingDirectories[language], language + "-profile"); - Console.WriteLine("profileDirectory start "); - Console.WriteLine(profileDirectory); - Console.WriteLine(serviceLanguageInfo.Project); - Console.WriteLine("profileDirectory end "); if (!Directory.Exists(profileDirectory)) { profileDirectories.Add(Directory.CreateDirectory(profileDirectory)); From a3b80051915b1bd1b3df22e4048e2e7302b82ffc Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Sat, 11 Feb 2023 01:26:18 +0000 Subject: [PATCH 09/33] testing --- .../Azure.Sdk.Tools.PerfAutomation/Cpp.cs | 3 ++- .../Azure.Sdk.Tools.PerfAutomation/Java.cs | 3 ++- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 12 ++++++++++-- .../Azure.Sdk.Tools.PerfAutomation/Net.cs | 3 ++- .../Azure.Sdk.Tools.PerfAutomation/Program.cs | 3 ++- .../Azure.Sdk.Tools.PerfAutomation/Python.cs | 3 ++- 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Cpp.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Cpp.cs index df8db37c5e8..2868850f324 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Cpp.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Cpp.cs @@ -68,7 +68,8 @@ public override async Task RunAsync( string testName, string arguments, bool profile, - object context) + object context, + int iteration) { var perfExe = (string)context; diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Java.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Java.cs index 78c410c1bf1..4e99ec29857 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Java.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Java.cs @@ -113,7 +113,8 @@ public override async Task RunAsync( string testName, string arguments, bool profile, - object context) + object context, + int iteration) { var jarFile = (string)context; diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index 41effb5d402..61c103562e4 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -131,7 +131,8 @@ public override async Task RunAsync( string testName, string arguments, bool profile, - object context) + object context, + int iteration) { var runtimePackageVersions = (Dictionary) context; @@ -141,7 +142,14 @@ public override async Task RunAsync( var projectDirectory = Path.Combine(WorkingDirectory, project); if(profile){ - arguments = arguments + " --profile true"; + Console.WriteLine("-- profile start --"); + Console.WriteLine(primaryPackage); + Console.WriteLine(Serialize(packageVersions.ToList())); + var profileOutputPath = Path.GetFullPath(Path.Combine(ProfileDirectory, primaryPackage, $"{testName}_{iteration}.cpuprofile")); + arguments = arguments + $" --profile true --profile-filepath {testName}_{iteration}.cpuprofile"; + Console.WriteLine(profileOutputPath); + Console.WriteLine(arguments); + Console.WriteLine("-- profile end --"); } var testResult = await Util.RunAsync("npm", $"run perf-test:node -- {testName} {arguments}", projectDirectory, outputBuilder: outputBuilder, errorBuilder: errorBuilder, throwOnError: false); diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Net.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Net.cs index bf57bf9f566..8dda2f1f80a 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Net.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Net.cs @@ -94,7 +94,8 @@ public override async Task RunAsync( string testName, string arguments, bool profile, - object context) + object context, + int iteration) { var dllName = Path.GetFileNameWithoutExtension(project) + ".dll"; var dllPath = Path.Combine(PublishDirectory, dllName); diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs index 0f1f5d021f3..6bceecd0ac0 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs @@ -386,7 +386,8 @@ private static async Task RunPackageVersion(RunOptions options, string outputJso test.TestNames[language], allArguments, options.Profile, - context + context, + i // iteration number ); } catch (Exception e) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Python.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Python.cs index 67a5db17094..621a4e1b550 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Python.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Python.cs @@ -76,7 +76,8 @@ public override async Task RunAsync( string testName, string arguments, bool profile, - object context) + object context, + int iteration) { var projectDirectory = Path.Combine(WorkingDirectory, project); From bd92b20831de053192be08a7fdc4b3977a32e39d Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Sat, 11 Feb 2023 01:46:51 +0000 Subject: [PATCH 10/33] ILanguage fix --- .../Azure.Sdk.Tools.PerfAutomation/ILanguage.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/ILanguage.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/ILanguage.cs index ba3d10b39bb..0d2ea76b602 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/ILanguage.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/ILanguage.cs @@ -24,6 +24,7 @@ Task RunAsync( string testName, string arguments, bool profile, - object context); + object context, + int iteration); } } From 3256566715bf6f1531738512cd2365c65f8116c8 Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Sat, 11 Feb 2023 01:55:45 +0000 Subject: [PATCH 11/33] LanguageBase update --- .../Azure.Sdk.Tools.PerfAutomation/LanguageBase.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/LanguageBase.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/LanguageBase.cs index e976bf68505..ef9e0fe6f6a 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/LanguageBase.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/LanguageBase.cs @@ -26,7 +26,8 @@ public abstract Task RunAsync( string testName, string arguments, bool profile, - object context); + object context, + int iteration); public abstract Task<(string output, string error, object context)> SetupAsync( string project, From ac31a8e008e84fc0f580a234fffb00cc1ad2d63a Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Sat, 11 Feb 2023 02:10:51 +0000 Subject: [PATCH 12/33] build fixes --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index d08254e9d5d..7a1954515ea 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -7,6 +7,8 @@ using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; +using static System.Text.Json.JsonSerializer; +using System.Linq; namespace Azure.Sdk.Tools.PerfAutomation { @@ -145,7 +147,7 @@ public override async Task RunAsync( Console.WriteLine("-- profile start --"); Console.WriteLine(primaryPackage); Console.WriteLine(Serialize(packageVersions.ToList())); - var profileOutputPath = Path.GetFullPath(Path.Combine(ProfileDirectory, primaryPackage, $"{testName}_{iteration}.cpuprofile")); + var profileOutputPath = Path.GetFullPath(Path.Combine(Util.GetProfileDirectory(WorkingDirectory),primaryPackage, $"{testName}_{iteration}.cpuprofile")); arguments = arguments + $" --profile true --profile-filepath {testName}_{iteration}.cpuprofile"; Console.WriteLine(profileOutputPath); Console.WriteLine(arguments); From f9f84832334a588a516ee90d59dbcffe49458080 Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Sat, 11 Feb 2023 02:14:25 +0000 Subject: [PATCH 13/33] delete unneeded dependency --- .../perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index 7a1954515ea..8f655a7f1f4 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -8,7 +8,6 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using static System.Text.Json.JsonSerializer; -using System.Linq; namespace Azure.Sdk.Tools.PerfAutomation { From 56f92e74feb387e3c079e3a5fac1cf93d5a99e9d Mon Sep 17 00:00:00 2001 From: Harsha Nalluru <@sanallur@microsoft.com> Date: Sat, 11 Feb 2023 03:34:12 +0000 Subject: [PATCH 14/33] strip package name --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index 8f655a7f1f4..026788495ee 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -146,7 +146,9 @@ public override async Task RunAsync( Console.WriteLine("-- profile start --"); Console.WriteLine(primaryPackage); Console.WriteLine(Serialize(packageVersions.ToList())); - var profileOutputPath = Path.GetFullPath(Path.Combine(Util.GetProfileDirectory(WorkingDirectory),primaryPackage, $"{testName}_{iteration}.cpuprofile")); + var stripPackageName = primaryPackage.Split(new char[] { '/' })[1]; + var profileOutputPath = Path.GetFullPath(Path.Combine(Util.GetProfileDirectory(WorkingDirectory),stripPackageName, $"{packageVersions[primaryPackage]}_{testName}_{iteration}.cpuprofile")); + arguments = arguments + $" --profile true --profile-filepath {testName}_{iteration}.cpuprofile"; Console.WriteLine(profileOutputPath); Console.WriteLine(arguments); From d793cb084c5a1a93c654ac3530f197be06ded373 Mon Sep 17 00:00:00 2001 From: Harsha Nalluru <@sanallur@microsoft.com> Date: Sat, 11 Feb 2023 03:54:40 +0000 Subject: [PATCH 15/33] remove console logs --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index 026788495ee..63dd7de1a54 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -143,16 +143,9 @@ public override async Task RunAsync( var projectDirectory = Path.Combine(WorkingDirectory, project); if(profile){ - Console.WriteLine("-- profile start --"); - Console.WriteLine(primaryPackage); - Console.WriteLine(Serialize(packageVersions.ToList())); var stripPackageName = primaryPackage.Split(new char[] { '/' })[1]; var profileOutputPath = Path.GetFullPath(Path.Combine(Util.GetProfileDirectory(WorkingDirectory),stripPackageName, $"{packageVersions[primaryPackage]}_{testName}_{iteration}.cpuprofile")); - arguments = arguments + $" --profile true --profile-filepath {testName}_{iteration}.cpuprofile"; - Console.WriteLine(profileOutputPath); - Console.WriteLine(arguments); - Console.WriteLine("-- profile end --"); } var testResult = await Util.RunAsync("npm", $"run perf-test:node -- {testName} {arguments}", projectDirectory, outputBuilder: outputBuilder, errorBuilder: errorBuilder, throwOnError: false); From 35089757535df3e4088ad1f2e141366bf1e3689d Mon Sep 17 00:00:00 2001 From: Harsha Nalluru <@sanallur@microsoft.com> Date: Sat, 11 Feb 2023 04:25:46 +0000 Subject: [PATCH 16/33] profileOutputPath --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index 63dd7de1a54..0957f377cf9 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -145,7 +145,7 @@ public override async Task RunAsync( if(profile){ var stripPackageName = primaryPackage.Split(new char[] { '/' })[1]; var profileOutputPath = Path.GetFullPath(Path.Combine(Util.GetProfileDirectory(WorkingDirectory),stripPackageName, $"{packageVersions[primaryPackage]}_{testName}_{iteration}.cpuprofile")); - arguments = arguments + $" --profile true --profile-filepath {testName}_{iteration}.cpuprofile"; + arguments = arguments + $" --profile true --profile-filepath {profileOutputPath}"; } var testResult = await Util.RunAsync("npm", $"run perf-test:node -- {testName} {arguments}", projectDirectory, outputBuilder: outputBuilder, errorBuilder: errorBuilder, throwOnError: false); From b8ade9523adaad3baaae02a262b6490dc0de291e Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Mon, 13 Feb 2023 11:00:28 -0800 Subject: [PATCH 17/33] Update tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index 0957f377cf9..6c4dca4b521 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -143,7 +143,7 @@ public override async Task RunAsync( var projectDirectory = Path.Combine(WorkingDirectory, project); if(profile){ - var stripPackageName = primaryPackage.Split(new char[] { '/' })[1]; + var stripPackageName = primaryPackage.Split(new char[] { '/' })[1]; // "@azure/storage-blob" -> "storage-blob" var profileOutputPath = Path.GetFullPath(Path.Combine(Util.GetProfileDirectory(WorkingDirectory),stripPackageName, $"{packageVersions[primaryPackage]}_{testName}_{iteration}.cpuprofile")); arguments = arguments + $" --profile true --profile-filepath {profileOutputPath}"; } From 5fccad2bb68e3783cc97436beb15d01d0e440df8 Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Thu, 16 Feb 2023 19:32:03 -0800 Subject: [PATCH 18/33] Update tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs Co-authored-by: Mike Harder --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index 6c4dca4b521..a2ab1682f86 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -145,7 +145,7 @@ public override async Task RunAsync( if(profile){ var stripPackageName = primaryPackage.Split(new char[] { '/' })[1]; // "@azure/storage-blob" -> "storage-blob" var profileOutputPath = Path.GetFullPath(Path.Combine(Util.GetProfileDirectory(WorkingDirectory),stripPackageName, $"{packageVersions[primaryPackage]}_{testName}_{iteration}.cpuprofile")); - arguments = arguments + $" --profile true --profile-filepath {profileOutputPath}"; + arguments += $" --profile true --profile-filepath {profileOutputPath}"; } var testResult = await Util.RunAsync("npm", $"run perf-test:node -- {testName} {arguments}", projectDirectory, outputBuilder: outputBuilder, errorBuilder: errorBuilder, throwOnError: false); From 3c141f4a2f395d95f28ffc19450e0c13db525d6d Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Thu, 16 Feb 2023 19:32:21 -0800 Subject: [PATCH 19/33] Update tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index a2ab1682f86..d388c8646be 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -145,7 +145,7 @@ public override async Task RunAsync( if(profile){ var stripPackageName = primaryPackage.Split(new char[] { '/' })[1]; // "@azure/storage-blob" -> "storage-blob" var profileOutputPath = Path.GetFullPath(Path.Combine(Util.GetProfileDirectory(WorkingDirectory),stripPackageName, $"{packageVersions[primaryPackage]}_{testName}_{iteration}.cpuprofile")); - arguments += $" --profile true --profile-filepath {profileOutputPath}"; + arguments += $" --profile --profile-filepath {profileOutputPath}"; } var testResult = await Util.RunAsync("npm", $"run perf-test:node -- {testName} {arguments}", projectDirectory, outputBuilder: outputBuilder, errorBuilder: errorBuilder, throwOnError: false); From 341dd0d6ab39152216005f27c6c7d9f3820ded0c Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Fri, 17 Feb 2023 04:51:24 +0000 Subject: [PATCH 20/33] address feedback --- tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Cpp.cs | 3 +-- .../Azure.Sdk.Tools.PerfAutomation/ILanguage.cs | 3 +-- .../perf-automation/Azure.Sdk.Tools.PerfAutomation/Java.cs | 3 +-- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 6 +++--- .../Azure.Sdk.Tools.PerfAutomation/LanguageBase.cs | 3 +-- tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Net.cs | 3 +-- .../Azure.Sdk.Tools.PerfAutomation/Python.cs | 3 +-- 7 files changed, 9 insertions(+), 15 deletions(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Cpp.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Cpp.cs index 2868850f324..df8db37c5e8 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Cpp.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Cpp.cs @@ -68,8 +68,7 @@ public override async Task RunAsync( string testName, string arguments, bool profile, - object context, - int iteration) + object context) { var perfExe = (string)context; diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/ILanguage.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/ILanguage.cs index 0148365173d..b7d4ae900f2 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/ILanguage.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/ILanguage.cs @@ -26,7 +26,6 @@ Task RunAsync( string testName, string arguments, bool profile, - object context, - int iteration); + object context); } } diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Java.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Java.cs index ea306cd3713..08d14beaea9 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Java.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Java.cs @@ -113,8 +113,7 @@ public override async Task RunAsync( string testName, string arguments, bool profile, - object context, - int iteration) + object context) { var jarFile = (string)context; diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index 0957f377cf9..4f1251e9537 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -16,6 +16,7 @@ public class JavaScript : LanguageBase private const string _rush = "common/scripts/install-run-rush.js"; protected override Language Language => Language.JS; + private static int profileCount = 0; public override async Task<(string output, string error, object context)> SetupAsync( string project, @@ -132,8 +133,7 @@ public override async Task RunAsync( string testName, string arguments, bool profile, - object context, - int iteration) + object context) { var runtimePackageVersions = (Dictionary)context; @@ -144,7 +144,7 @@ public override async Task RunAsync( if(profile){ var stripPackageName = primaryPackage.Split(new char[] { '/' })[1]; - var profileOutputPath = Path.GetFullPath(Path.Combine(Util.GetProfileDirectory(WorkingDirectory),stripPackageName, $"{packageVersions[primaryPackage]}_{testName}_{iteration}.cpuprofile")); + var profileOutputPath = Path.GetFullPath(Path.Combine(Util.GetProfileDirectory(WorkingDirectory),stripPackageName, $"{packageVersions[primaryPackage]}_{testName}_{profileCount++}.cpuprofile")); arguments = arguments + $" --profile true --profile-filepath {profileOutputPath}"; } var testResult = await Util.RunAsync("npm", $"run perf-test:node -- {testName} {arguments}", diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/LanguageBase.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/LanguageBase.cs index f6a8e0f33df..0918be74271 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/LanguageBase.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/LanguageBase.cs @@ -24,8 +24,7 @@ public abstract Task RunAsync( string testName, string arguments, bool profile, - object context, - int iteration); + object context); public abstract Task<(string output, string error, object context)> SetupAsync( string project, diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Net.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Net.cs index 8dda2f1f80a..bf57bf9f566 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Net.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Net.cs @@ -94,8 +94,7 @@ public override async Task RunAsync( string testName, string arguments, bool profile, - object context, - int iteration) + object context) { var dllName = Path.GetFileNameWithoutExtension(project) + ".dll"; var dllPath = Path.Combine(PublishDirectory, dllName); diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Python.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Python.cs index 621a4e1b550..67a5db17094 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Python.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Python.cs @@ -76,8 +76,7 @@ public override async Task RunAsync( string testName, string arguments, bool profile, - object context, - int iteration) + object context) { var projectDirectory = Path.Combine(WorkingDirectory, project); From c8abcd6fe3345a361ff590b4e65153cd270774d1 Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Fri, 17 Feb 2023 04:54:16 +0000 Subject: [PATCH 21/33] remove i --- tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs index 246997e7d1a..7dd6c9cd991 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs @@ -355,7 +355,6 @@ private static async Task RunPackageVersion( allArguments, options.Profile, context, - i // iteration number ); } catch (Exception e) From 9cd3e1dabd7d56ad8fb8268b51db0c08f67e8eab Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Thu, 16 Feb 2023 20:54:38 -0800 Subject: [PATCH 22/33] Update tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs Co-authored-by: Mike Harder --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index 448e4d72a3d..0410073edb6 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -142,7 +142,8 @@ public override async Task RunAsync( var projectDirectory = Path.Combine(WorkingDirectory, project); - if(profile){ + if (profile) + { var stripPackageName = primaryPackage.Split(new char[] { '/' })[1]; // "@azure/storage-blob" -> "storage-blob" var profileOutputPath = Path.GetFullPath(Path.Combine(Util.GetProfileDirectory(WorkingDirectory),stripPackageName, $"{packageVersions[primaryPackage]}_{testName}_{profileCount++}.cpuprofile")); From 945707c8c66e4a73209e05247df88fa30939cc5a Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Sat, 18 Feb 2023 03:17:44 +0000 Subject: [PATCH 23/33] strip package name --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index 448e4d72a3d..2fd619bde0f 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -143,7 +143,7 @@ public override async Task RunAsync( var projectDirectory = Path.Combine(WorkingDirectory, project); if(profile){ - var stripPackageName = primaryPackage.Split(new char[] { '/' })[1]; + var stripPackageName = primaryPackage.Substring(primaryPackage.LastIndexOf('/') + 1); // "@azure/storage-blob" -> "storage-blob" var profileOutputPath = Path.GetFullPath(Path.Combine(Util.GetProfileDirectory(WorkingDirectory),stripPackageName, $"{packageVersions[primaryPackage]}_{testName}_{profileCount++}.cpuprofile")); arguments = arguments + $" --profile --profile-path {profileOutputPath}"; From cd8430405f315785b4799afb61314a9d81cfa590 Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Sat, 18 Feb 2023 03:30:59 +0000 Subject: [PATCH 24/33] add arguments in the name of the profile generated --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index 0447ff94395..cf97664ebf3 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -146,7 +146,7 @@ public override async Task RunAsync( { var stripPackageName = primaryPackage.Substring(primaryPackage.LastIndexOf('/') + 1); // "@azure/storage-blob" -> "storage-blob" - var profileOutputPath = Path.GetFullPath(Path.Combine(Util.GetProfileDirectory(WorkingDirectory),stripPackageName, $"{packageVersions[primaryPackage]}_{testName}_{profileCount++}.cpuprofile")); + var profileOutputPath = Path.GetFullPath(Path.Combine(Util.GetProfileDirectory(WorkingDirectory),stripPackageName, $"{packageVersions[primaryPackage]}_{testName}_{arguments.Replace("--","_").Replace(" ","-")}_{profileCount++}.cpuprofile")); arguments = arguments + $" --profile --profile-path {profileOutputPath}"; } var testResult = await Util.RunAsync("npm", $"run perf-test:node -- {testName} {arguments}", From 0f9c436bbc1dbe557403fe95ea64397b4d4c3dbd Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Fri, 17 Feb 2023 21:59:36 -0800 Subject: [PATCH 25/33] Fix formatting --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 2 +- tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index cf97664ebf3..31321b210c4 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -147,7 +147,7 @@ public override async Task RunAsync( var stripPackageName = primaryPackage.Substring(primaryPackage.LastIndexOf('/') + 1); // "@azure/storage-blob" -> "storage-blob" var profileOutputPath = Path.GetFullPath(Path.Combine(Util.GetProfileDirectory(WorkingDirectory),stripPackageName, $"{packageVersions[primaryPackage]}_{testName}_{arguments.Replace("--","_").Replace(" ","-")}_{profileCount++}.cpuprofile")); - arguments = arguments + $" --profile --profile-path {profileOutputPath}"; + arguments += $" --profile --profile-path {profileOutputPath}"; } var testResult = await Util.RunAsync("npm", $"run perf-test:node -- {testName} {arguments}", projectDirectory, outputBuilder: outputBuilder, errorBuilder: errorBuilder, throwOnError: false); diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs index 7dd6c9cd991..797c286f938 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs @@ -354,7 +354,7 @@ private static async Task RunPackageVersion( test.Class, allArguments, options.Profile, - context, + context ); } catch (Exception e) From cc6501b51cf5d90df760ab5aac1dc1c1f761f7ca Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Fri, 17 Feb 2023 22:00:24 -0800 Subject: [PATCH 26/33] Remove unnecessary using --- .../perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index 31321b210c4..83c31f9e3ca 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -7,7 +7,6 @@ using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; -using static System.Text.Json.JsonSerializer; namespace Azure.Sdk.Tools.PerfAutomation { From f1f629078e92f6b9366e5bbe85f6cbac9d0ea293 Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Fri, 17 Feb 2023 22:04:00 -0800 Subject: [PATCH 27/33] Remove whitespace --- .../perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs index 797c286f938..99ef0c1e67e 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/Program.cs @@ -354,8 +354,7 @@ private static async Task RunPackageVersion( test.Class, allArguments, options.Profile, - context - ); + context); } catch (Exception e) { From 43ee8978e2614fac969956a1d6afeaaa0a22b5f9 Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Fri, 17 Feb 2023 22:08:20 -0800 Subject: [PATCH 28/33] Improve formatting --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index 83c31f9e3ca..f0c88393d7b 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -143,9 +143,14 @@ public override async Task RunAsync( if (profile) { - var stripPackageName = primaryPackage.Substring(primaryPackage.LastIndexOf('/') + 1); // "@azure/storage-blob" -> "storage-blob" - var profileOutputPath = Path.GetFullPath(Path.Combine(Util.GetProfileDirectory(WorkingDirectory),stripPackageName, $"{packageVersions[primaryPackage]}_{testName}_{arguments.Replace("--","_").Replace(" ","-")}_{profileCount++}.cpuprofile")); + var stripPackageName = primaryPackage.Substring(primaryPackage.LastIndexOf('/') + 1); + + var formattedArgs = arguments.Replace("--", "_").Replace(" ", "-"); + var profileFilename = $"{packageVersions[primaryPackage]}_{testName}_{formattedArgs}_{profileCount++}.cpuprofile"; + var profileDir = Util.GetProfileDirectory(WorkingDirectory); + var profileOutputPath = Path.GetFullPath(Path.Combine(profileDir, stripPackageName, profileFilename)); + arguments += $" --profile --profile-path {profileOutputPath}"; } var testResult = await Util.RunAsync("npm", $"run perf-test:node -- {testName} {arguments}", From 68a8935d2261e8da733dede4ce8a333917b03741 Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Fri, 17 Feb 2023 22:09:08 -0800 Subject: [PATCH 29/33] Code cleanup --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index f0c88393d7b..e81c86e0bf7 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -150,7 +150,7 @@ public override async Task RunAsync( var profileFilename = $"{packageVersions[primaryPackage]}_{testName}_{formattedArgs}_{profileCount++}.cpuprofile"; var profileDir = Util.GetProfileDirectory(WorkingDirectory); var profileOutputPath = Path.GetFullPath(Path.Combine(profileDir, stripPackageName, profileFilename)); - + arguments += $" --profile --profile-path {profileOutputPath}"; } var testResult = await Util.RunAsync("npm", $"run perf-test:node -- {testName} {arguments}", From 03ef2a184271f562e5f0dae5435789fffd3a0d11 Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Tue, 21 Feb 2023 03:17:19 +0000 Subject: [PATCH 30/33] .TrimEnd(" ") --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index e81c86e0bf7..76593f936df 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -146,7 +146,7 @@ public override async Task RunAsync( // "@azure/storage-blob" -> "storage-blob" var stripPackageName = primaryPackage.Substring(primaryPackage.LastIndexOf('/') + 1); - var formattedArgs = arguments.Replace("--", "_").Replace(" ", "-"); + var formattedArgs = arguments.Replace("--", "_").TrimEnd(" ").Replace(" ", "-"); var profileFilename = $"{packageVersions[primaryPackage]}_{testName}_{formattedArgs}_{profileCount++}.cpuprofile"; var profileDir = Util.GetProfileDirectory(WorkingDirectory); var profileOutputPath = Path.GetFullPath(Path.Combine(profileDir, stripPackageName, profileFilename)); From 1a331eccb5763f51d838ad512255a7f22ac5e028 Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Tue, 21 Feb 2023 03:27:21 +0000 Subject: [PATCH 31/33] default is space for trimend --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index 76593f936df..4562712e4fc 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -146,7 +146,7 @@ public override async Task RunAsync( // "@azure/storage-blob" -> "storage-blob" var stripPackageName = primaryPackage.Substring(primaryPackage.LastIndexOf('/') + 1); - var formattedArgs = arguments.Replace("--", "_").TrimEnd(" ").Replace(" ", "-"); + var formattedArgs = arguments.Replace("--", "_").TrimEnd().Replace(" ", "-"); var profileFilename = $"{packageVersions[primaryPackage]}_{testName}_{formattedArgs}_{profileCount++}.cpuprofile"; var profileDir = Util.GetProfileDirectory(WorkingDirectory); var profileOutputPath = Path.GetFullPath(Path.Combine(profileDir, stripPackageName, profileFilename)); From 1595d7e72195609e82d6a805ff676a0b22b8e86e Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Tue, 21 Feb 2023 03:51:56 +0000 Subject: [PATCH 32/33] " --" -> "_" --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index 4562712e4fc..04f7b3bd51f 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -146,7 +146,7 @@ public override async Task RunAsync( // "@azure/storage-blob" -> "storage-blob" var stripPackageName = primaryPackage.Substring(primaryPackage.LastIndexOf('/') + 1); - var formattedArgs = arguments.Replace("--", "_").TrimEnd().Replace(" ", "-"); + var formattedArgs = arguments.Replace(" --", "_").Replace(" ", "-"); var profileFilename = $"{packageVersions[primaryPackage]}_{testName}_{formattedArgs}_{profileCount++}.cpuprofile"; var profileDir = Util.GetProfileDirectory(WorkingDirectory); var profileOutputPath = Path.GetFullPath(Path.Combine(profileDir, stripPackageName, profileFilename)); From b822494fba66408b0b2a093127c61f1f715c59bd Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Tue, 21 Feb 2023 04:09:12 +0000 Subject: [PATCH 33/33] .Replace(" --", "_").Replace("--", "_"). --- .../Azure.Sdk.Tools.PerfAutomation/JavaScript.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs index 04f7b3bd51f..e1bc54601bd 100644 --- a/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs +++ b/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/JavaScript.cs @@ -146,7 +146,7 @@ public override async Task RunAsync( // "@azure/storage-blob" -> "storage-blob" var stripPackageName = primaryPackage.Substring(primaryPackage.LastIndexOf('/') + 1); - var formattedArgs = arguments.Replace(" --", "_").Replace(" ", "-"); + var formattedArgs = arguments.Replace(" --", "_").Replace("--", "_").Replace(" ", "-"); var profileFilename = $"{packageVersions[primaryPackage]}_{testName}_{formattedArgs}_{profileCount++}.cpuprofile"; var profileDir = Util.GetProfileDirectory(WorkingDirectory); var profileOutputPath = Path.GetFullPath(Path.Combine(profileDir, stripPackageName, profileFilename));