You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by aa...@apache.org on 2023/03/17 06:01:46 UTC

[rocketmq-clients] branch master updated (9c4e934d -> 2234f70f)

This is an automated email from the ASF dual-hosted git repository.

aaronai pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git


    from 9c4e934d Add more comments about disable TLS/SSL on .NET Core 3.1
     new fdbe255f Enable ServerGarbageCollection for example
     new 2234f70f Add more stats info

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 csharp/README-CN.md                        | 2 +-
 csharp/examples/ProducerBenchmark.cs       | 2 +-
 csharp/examples/examples.csproj            | 1 +
 csharp/rocketmq-client-csharp/Client.cs    | 4 +++-
 csharp/rocketmq-client-csharp/Utilities.cs | 6 ++++--
 5 files changed, 10 insertions(+), 5 deletions(-)


[rocketmq-clients] 01/02: Enable ServerGarbageCollection for example

Posted by aa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aaronai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git

commit fdbe255f8c0f0f9fbe85e84d89a060e206a3d448
Author: Aaron Ai <ya...@gmail.com>
AuthorDate: Fri Mar 17 13:47:00 2023 +0800

    Enable ServerGarbageCollection for example
---
 csharp/README-CN.md                        | 2 +-
 csharp/examples/examples.csproj            | 1 +
 csharp/rocketmq-client-csharp/Utilities.cs | 6 ++++--
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/csharp/README-CN.md b/csharp/README-CN.md
index dadaf2e9..7f3a343e 100644
--- a/csharp/README-CN.md
+++ b/csharp/README-CN.md
@@ -49,7 +49,7 @@ dotnet test -l "console;verbosity=detailed"
 
 ## 日志系统
 
-我们使用 [NLog](https://nlog-project.org/) 作为日志实现,与 Java 客户端类似,我们允许使用环境来自定义日志相关的配置。
+我们使用 [NLog](https://nlog-project.org/) 作为日志实现,与 Java 客户端类似,我们允许使用环境变量来自定义日志相关的配置。
 
 * `rocketmq_log_level`:日志输出级别,默认为 INFO。
 * `rocketmq_log_root`
diff --git a/csharp/examples/examples.csproj b/csharp/examples/examples.csproj
index 37f6a477..c4836826 100644
--- a/csharp/examples/examples.csproj
+++ b/csharp/examples/examples.csproj
@@ -6,5 +6,6 @@
     <PropertyGroup>
         <OutputType>Exe</OutputType>
         <TargetFrameworks>net5.0;netcoreapp3.1</TargetFrameworks>
+        <ServerGarbageCollection>true</ServerGarbageCollection>
     </PropertyGroup>
 </Project>
diff --git a/csharp/rocketmq-client-csharp/Utilities.cs b/csharp/rocketmq-client-csharp/Utilities.cs
index 5505a277..ca334b9b 100644
--- a/csharp/rocketmq-client-csharp/Utilities.cs
+++ b/csharp/rocketmq-client-csharp/Utilities.cs
@@ -30,6 +30,8 @@ namespace Org.Apache.Rocketmq
     public static class Utilities
     {
         private static long _instanceSequence = 0;
+        private static readonly int ProcessId = Process.GetCurrentProcess().Id;
+        private static readonly string HostName = System.Net.Dns.GetHostName();
         public const int MasterBrokerId = 0;
 
         public static int GetPositiveMod(int k, int n)
@@ -47,12 +49,12 @@ namespace Org.Apache.Rocketmq
 
         public static int GetProcessId()
         {
-            return Process.GetCurrentProcess().Id;
+            return ProcessId;
         }
 
         public static string GetHostName()
         {
-            return System.Net.Dns.GetHostName();
+            return HostName;
         }
 
         public static string GetClientId()


[rocketmq-clients] 02/02: Add more stats info

Posted by aa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aaronai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git

commit 2234f70f54fd9182ac73f763283fd84053ed8b1a
Author: Aaron Ai <ya...@gmail.com>
AuthorDate: Fri Mar 17 13:49:54 2023 +0800

    Add more stats info
---
 csharp/examples/ProducerBenchmark.cs    | 2 +-
 csharp/rocketmq-client-csharp/Client.cs | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/csharp/examples/ProducerBenchmark.cs b/csharp/examples/ProducerBenchmark.cs
index 5e3d4632..2b2ff427 100644
--- a/csharp/examples/ProducerBenchmark.cs
+++ b/csharp/examples/ProducerBenchmark.cs
@@ -30,7 +30,7 @@ namespace examples
         private static readonly Logger Logger = MqLogManager.Instance.GetCurrentClassLogger();
 
         private static readonly SemaphoreSlim Semaphore = new SemaphoreSlim(0);
-        private const int TpsLimit = 300;
+        private const int TpsLimit = 1024;
         private static long _successCounter;
         private static long _failureCounter;
 
diff --git a/csharp/rocketmq-client-csharp/Client.cs b/csharp/rocketmq-client-csharp/Client.cs
index d619280b..2a2c9716 100644
--- a/csharp/rocketmq-client-csharp/Client.cs
+++ b/csharp/rocketmq-client-csharp/Client.cs
@@ -255,7 +255,9 @@ namespace Org.Apache.Rocketmq
             ThreadPool.GetAvailableThreads(out var availableWorker, out var availableIo);
             Logger.Info(
                 $"ClientId={ClientId}, ClientVersion={MetadataConstants.Instance.ClientVersion}, " +
-                $".NET Version={Environment.Version}, AvailableWorkerThreads={availableWorker}, " +
+                $".NET Version={Environment.Version}, ThreadCount={ThreadPool.ThreadCount}, " +
+                $"CompletedWorkItemCount={ThreadPool.CompletedWorkItemCount}, " +
+                $"PendingWorkItemCount={ThreadPool.PendingWorkItemCount}, AvailableWorkerThreads={availableWorker}, " +
                 $"AvailableCompletionPortThreads={availableIo}");
         }