This commit is contained in:
2026-09-03 04:31:37 +03:00
parent 61ec566f63
commit 69a50d8b20
4 changed files with 281 additions and 0 deletions
@@ -328,6 +328,9 @@ partial class EpConnection
var c = (uint)Interlocked.Increment(ref _callbackCounter);
//callbackCounter++; // avoid thread racing
_requests.Add(c, reply);
var metrics = _runtimeMetrics;
if (metrics != null)
Interlocked.Increment(ref metrics.SentRequests);
try
{
@@ -383,6 +386,9 @@ partial class EpConnection
() => SendRequest(EpPacketRequest.ResumeExecution, callbackId));
_requests.Add(callbackId, reply);
var metrics = _runtimeMetrics;
if (metrics != null)
Interlocked.Increment(ref metrics.SentRequests);
try
{
SendRequestPacket(action, callbackId, args);
@@ -409,6 +415,9 @@ partial class EpConnection
() => SendRequest(EpPacketRequest.ResumeExecution, callbackId));
_requests.Add(callbackId, reply);
var metrics = _runtimeMetrics;
if (metrics != null)
Interlocked.Increment(ref metrics.SentRequests);
try
{
SendRequestPacket(action, callbackId, args);
@@ -507,6 +516,15 @@ partial class EpConnection
{
var reply = new AsyncReply();
var metrics = _runtimeMetrics;
if (metrics != null)
{
Interlocked.Increment(ref metrics.SentNotifications);
if (action == EpPacketNotification.PropertyModified)
Interlocked.Increment(ref metrics.SentPropertyModifications);
else if (action == EpPacketNotification.EventOccurred)
Interlocked.Increment(ref metrics.SentEvents);
}
if (args.Length == 0)
{
@@ -535,6 +553,16 @@ partial class EpConnection
if (Instance == null)
return;
var metrics = _runtimeMetrics;
if (metrics != null)
{
Interlocked.Increment(ref metrics.SentReplies);
if (action == EpPacketReply.PermissionError ||
action == EpPacketReply.ExecutionError ||
action == EpPacketReply.Warning)
Interlocked.Increment(ref metrics.SentErrors);
}
try
{
if (args.Length == 0)