diff --git a/ThroughputTest_v2/ServiceBusThroughputTest.Common/Properties/AssemblyInfo.cs b/ThroughputTest_v2/ServiceBusThroughputTest.Common/Properties/AssemblyInfo.cs deleted file mode 100644 index e9f28b3..0000000 --- a/ThroughputTest_v2/ServiceBusThroughputTest.Common/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ServiceBusThroughputTest.Common")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ServiceBusThroughputTest.Common")] -[assembly: AssemblyCopyright("Copyright © 2023")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("5d8a1d8a-c5b5-4fbc-b10e-1265a4a4ecbf")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ThroughputTest_v2/ServiceBusThroughputTest.Common/ServiceBusThroughputTest.Common.csproj b/ThroughputTest_v2/ServiceBusThroughputTest.Common/ServiceBusThroughputTest.Common.csproj index 1674f39..e4831c4 100644 --- a/ThroughputTest_v2/ServiceBusThroughputTest.Common/ServiceBusThroughputTest.Common.csproj +++ b/ThroughputTest_v2/ServiceBusThroughputTest.Common/ServiceBusThroughputTest.Common.csproj @@ -1,48 +1,13 @@ - - - - - Debug - AnyCPU - {5D8A1D8A-C5B5-4FBC-B10E-1265A4A4ECBF} - Library - Properties - ServiceBusThroughputTest.Common - ServiceBusThroughputTest.Common - v4.7.2 - 512 - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - + + + + net9.0 + enable + + + + + + + \ No newline at end of file diff --git a/ThroughputTest_v2/ServiceBusThroughputTest/Program.cs b/ThroughputTest_v2/ServiceBusThroughputTest/Program.cs index dde4f63..92c5407 100644 --- a/ThroughputTest_v2/ServiceBusThroughputTest/Program.cs +++ b/ThroughputTest_v2/ServiceBusThroughputTest/Program.cs @@ -1,9 +1,9 @@ //--------------------------------------------------------------------------------- -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // -// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, -// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. +// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, +// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. //--------------------------------------------------------------------------------- namespace ServiceBusThroughputTest @@ -17,21 +17,18 @@ namespace ServiceBusThroughputTest using CommandLine.Text; using System.Diagnostics; using ServiceBusThroughputTestLib; - using System.Configuration; class Program { const string connString = ""; const string queue = "queue1"; - const string MetricsSamplesPerDisplayIntervalSenderKeyName = "MetricsSamplesPerDisplayIntervalSender"; - const string MetricsSamplesPerDisplayIntervalReceiverKeyName = "MetricsSamplesPerDisplayIntervalReceiver"; const int MetricsSamplesPerDisplayIntervalSenderDefault = 2000; const int MetricsSamplesPerDisplayIntervalReceiverDefault = 10000; static void Main(string[] args) { CommandLine.Parser.Default.ParseArguments(args) - .WithParsed(opts => StartSendReceives(opts)); + .WithParsed(opts => StartSendReceives(opts)); } static void StartSendReceives(Settings settings) @@ -46,9 +43,8 @@ static void StartSendReceives(Settings settings) settings.PrintSettings(); - int metricsSamplesPerDisplayIntervalSender, metricsSamplesPerDisplayIntervalReceiver; - GetConfigValue(MetricsSamplesPerDisplayIntervalSenderKeyName, int.Parse, out metricsSamplesPerDisplayIntervalSender, MetricsSamplesPerDisplayIntervalSenderDefault); - GetConfigValue(MetricsSamplesPerDisplayIntervalReceiverKeyName, int.Parse, out metricsSamplesPerDisplayIntervalReceiver, MetricsSamplesPerDisplayIntervalReceiverDefault); + int metricsSamplesPerDisplayIntervalSender = MetricsSamplesPerDisplayIntervalSenderDefault; + int metricsSamplesPerDisplayIntervalReceiver = MetricsSamplesPerDisplayIntervalReceiverDefault; Console.WriteLine("Starting senders and receivers. Press Enter key to stop at anytime..."); @@ -127,7 +123,7 @@ private static void Metrics_OnMetricsDisplay(object _, MetricsDisplayEventArgs e Console.Write("R|{0,10}|{1,10}|{2,5}|{3,5}|", rList.First().Tick / Stopwatch.Frequency + 1, rList.Last().Tick / Stopwatch.Frequency + 1, settings.ReceiveBatchSize, settings.MaxInflightReceives); WriteStat(rList, i => i.ReceiveDuration100ns, Stopwatch.Frequency / 1000.0); - + var msgs = rList.Sum(i => i.Messages); receiveTotal += msgs; Console.Write("{0,10:0.00}|{1,10}|{2,10}|{3,10}|{4,10}|{5,10}|", rList.Sum(i => i.Messages) / (double)settings.MetricsDisplayFrequency, msgs, rList.Sum(i => i.Receives), rList.Sum(i => i.Errors), rList.Sum(i => i.BusyErrors), receiveTotal); @@ -157,33 +153,15 @@ static void WriteStat(IList list, Func f, double scale) Console.Write("{0,10:0.00}|{1,10:0.00}|{2,10:0.00}|{3,10:0.00}|", list.Average(f) / scale, list.Min(f) / scale, list.Max(f) / scale, Percentile(list.Select(s => f(s)).ToArray(), 0.99) / scale); } - static bool GetConfigValue(string keyName, Func parseFunc, out T val, T defaultVal = default(T)) - { - if (ConfigurationManager.AppSettings.AllKeys.Contains(keyName)) - { - try - { - val = parseFunc(ConfigurationManager.AppSettings[keyName]); - - return true; - } - catch { } - } - - val = defaultVal; - - return false; - } - static void TestSBReceiver() { - ServiceBusThroughputTestLib.Receiver receiver = new ServiceBusThroughputTestLib.Receiver(connString, "queue1", 1024*10, 10, 1024, 1, 60000, false); + ServiceBusThroughputTestLib.Receiver receiver = new ServiceBusThroughputTestLib.Receiver(connString, "queue1", 1024 * 10, 10, 1024, 1, 60000, false); CancellationTokenSource cts = new CancellationTokenSource(); Task rt = receiver.Run(cts.Token); Thread.Sleep(TimeSpan.FromMinutes(2)); cts.Cancel(); rt.Wait(); - } + } static void TestSBSender() { @@ -288,7 +266,7 @@ public static IEnumerable Examples get { yield return new Example("queue scenario", new Settings { ConnectionString = "{Connection-String}", QueueName = "{Queue-Name}" }); - yield return new Example("topic scenario", new Settings { ConnectionString = "{Connection-String}", QueueName = "{Topic-Name}:{Subsription-Name}"}); + yield return new Example("topic scenario", new Settings { ConnectionString = "{Connection-String}", QueueName = "{Topic-Name}:{Subsription-Name}" }); } } } diff --git a/ThroughputTest_v2/ServiceBusThroughputTest/Properties/AssemblyInfo.cs b/ThroughputTest_v2/ServiceBusThroughputTest/Properties/AssemblyInfo.cs deleted file mode 100644 index 1d13bc9..0000000 --- a/ThroughputTest_v2/ServiceBusThroughputTest/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ServiceBusThroughputTest")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ServiceBusThroughputTest")] -[assembly: AssemblyCopyright("Copyright © 2023")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("72a4a64b-eadb-4a0d-8541-6893895adfad")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ThroughputTest_v2/ServiceBusThroughputTest/ServiceBusThroughputTest.csproj b/ThroughputTest_v2/ServiceBusThroughputTest/ServiceBusThroughputTest.csproj index 73b157f..c5e57fe 100644 --- a/ThroughputTest_v2/ServiceBusThroughputTest/ServiceBusThroughputTest.csproj +++ b/ThroughputTest_v2/ServiceBusThroughputTest/ServiceBusThroughputTest.csproj @@ -1,77 +1,18 @@ - - - - - Debug - AnyCPU - {72A4A64B-EADB-4A0D-8541-6893895ADFAD} - Exe - ServiceBusThroughputTest - ServiceBusThroughputTest - v4.7.2 - 512 - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - 2.9.1 - - - 13.0.3 - - - 4.5.1 - - - - - {5d8a1d8a-c5b5-4fbc-b10e-1265a4a4ecbf} - ServiceBusThroughputTest.Common - - - {da73050d-b46d-4760-aef5-cd86e25dfab5} - ServiceBusThroughputTestLib - - - + + + + Exe + net9.0 + enable + + + + + + + + + + + \ No newline at end of file diff --git a/ThroughputTest_v2/ServiceBusThroughputTestLib/Properties/AssemblyInfo.cs b/ThroughputTest_v2/ServiceBusThroughputTestLib/Properties/AssemblyInfo.cs deleted file mode 100644 index ea1654d..0000000 --- a/ThroughputTest_v2/ServiceBusThroughputTestLib/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ServiceBusThroughputTestLib")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ServiceBusThroughputTestLib")] -[assembly: AssemblyCopyright("Copyright © 2023")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("da73050d-b46d-4760-aef5-cd86e25dfab5")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ThroughputTest_v2/ServiceBusThroughputTestLib/ServiceBusThroughputTestLib.csproj b/ThroughputTest_v2/ServiceBusThroughputTestLib/ServiceBusThroughputTestLib.csproj index e2362bc..1b22d17 100644 --- a/ThroughputTest_v2/ServiceBusThroughputTestLib/ServiceBusThroughputTestLib.csproj +++ b/ThroughputTest_v2/ServiceBusThroughputTestLib/ServiceBusThroughputTestLib.csproj @@ -1,61 +1,13 @@ - - - - - Debug - AnyCPU - {DA73050D-B46D-4760-AEF5-CD86E25DFAB5} - Library - Properties - ServiceBusThroughputTestLib - ServiceBusThroughputTestLib - v4.7.2 - 512 - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - 7.15.0 - - - - - {5d8a1d8a-c5b5-4fbc-b10e-1265a4a4ecbf} - ServiceBusThroughputTest.Common - - - + + + + + net9.0 + enable + + + + + + \ No newline at end of file