internal ServerCounters(EndPoint endpoint) { EndPoint = endpoint; Interactive = new ConnectionCounters(ConnectionType.Interactive); Subscription = new ConnectionCounters(ConnectionType.Subscription); Other = new ConnectionCounters(ConnectionType.None); }
/// <summary> /// Creates a <see cref="ServerCounters"/> instance for an <see cref="EndPoint"/>. /// </summary> /// <param name="endpoint">The <see cref="EndPoint"/> to create counters for.</param> public ServerCounters(EndPoint endpoint) { EndPoint = endpoint; Interactive = new ConnectionCounters(ConnectionType.Interactive); Subscription = new ConnectionCounters(ConnectionType.Subscription); Other = new ConnectionCounters(ConnectionType.None); }
internal void GetCounters(ConnectionCounters counters) { lock (outstanding) { counters.SentItemsAwaitingResponse = outstanding.Count; } counters.Subscriptions = SubscriptionCount; }
internal void GetCounters(ConnectionCounters counters) { counters.OperationCount = OperationCount; counters.SocketCount = Interlocked.Read(ref socketCount); counters.WriterCount = Interlocked.CompareExchange(ref activeWriters, 0, 0); counters.NonPreferredEndpointCount = Interlocked.Read(ref nonPreferredEndpointCount); physical?.GetCounters(counters); }
internal void GetCounters(ConnectionCounters counters) { counters.PendingUnsentItems = queue.Count(); counters.OperationCount = OperationCount; counters.SocketCount = Interlocked.Read(ref socketCount); counters.WriterCount = Interlocked.CompareExchange(ref activeWriters, 0, 0); counters.NonPreferredEndpointCount = Interlocked.Read(ref nonPreferredEndpointCount); completionManager.GetCounters(counters); physical?.GetCounters(counters); }
internal void GetCounters(ConnectionCounters counters) { lock (asyncCompletionQueue) { counters.ResponsesAwaitingAsyncCompletion = asyncCompletionQueue.Count; } counters.CompletedSynchronously = Interlocked.Read(ref completedSync); counters.CompletedAsynchronously = Interlocked.Read(ref completedAsync); counters.FailedAsynchronously = Interlocked.Read(ref failedAsync); }
internal void Add(ConnectionCounters other) { if (other == null) return; CompletedAsynchronously += other.CompletedAsynchronously; CompletedSynchronously += other.CompletedSynchronously; FailedAsynchronously += other.FailedAsynchronously; OperationCount += other.OperationCount; PendingUnsentItems += other.PendingUnsentItems; ResponsesAwaitingAsyncCompletion += other.ResponsesAwaitingAsyncCompletion; SentItemsAwaitingResponse += other.SentItemsAwaitingResponse; SocketCount += other.SocketCount; Subscriptions += other.Subscriptions; WriterCount += other.WriterCount; NonPreferredEndpointCount += other.NonPreferredEndpointCount; }
internal void GetCounters(ConnectionCounters counters) { counters.PendingUnsentItems = queue.Count(); counters.OperationCount = OperationCount; counters.SocketCount = Interlocked.Read(ref socketCount); counters.WriterCount = Interlocked.CompareExchange(ref activeWriters, 0, 0); counters.NonPreferredEndpointCount = Interlocked.Read(ref nonPreferredEndpointCount); completionManager.GetCounters(counters); var tmp = physical; if (tmp != null) { tmp.GetCounters(counters); } }
internal void GetCounters(ConnectionCounters counters) { counters.CompletedSynchronously = Interlocked.Read(ref completedSync); counters.CompletedAsynchronously = Interlocked.Read(ref completedAsync); counters.FailedAsynchronously = Interlocked.Read(ref failedAsync); }