static private MarkInternal ( int sampleId, int states ) : void | ||
sampleId | int | |
states | int | |
return | void |
internal static void OnSample(int id) { var states = Connections.Select(c => c.State); var statesArr = new int[3] { states.Where(s => s == ConnectionState.Connected).Count(), states.Where(s => s == ConnectionState.Reconnecting).Count(), states.Where(s => s == ConnectionState.Disconnected).Count() }; if (ControllerProxy != null) { ControllerProxy.Invoke("Mark", id, statesArr); } else { ControllerHub.MarkInternal(id, statesArr); } if (!Arguments.IsController) { Console.WriteLine("{0} Connected, {1} Reconnected, {2} Disconnected", statesArr[0], statesArr[1], statesArr[2]); } }
private static void SignalSample(TimeSpan timestamp) { Samples.Add(new ConnectionsSample(Enum.GetName(typeof(ControllerEvents), TestPhase), timestamp, PerformanceCounters.ServerAvailableMBytes, PerformanceCounters.ServerTcpConnectionsEst)); if (PerformanceCounters.SignalRCountersAvailable) { ControllerHub.MarkInternal(Samples.Count - 1, new int[] { PerformanceCounters.SignalRConnectionsCurrent, PerformanceCounters.SignalRConnectionsReconnected, PerformanceCounters.SignalRConnectionsDisconnected }); } else { // Use client connection states if (AppHost == null) { Client.OnSample(Samples.Count - 1); } else { BroadcastEvent(ControllerEvents.Sample, Samples.Count - 1); } } }