本文整理汇总了C#中IPerformanceCounterManager类的典型用法代码示例。如果您正苦于以下问题:C# IPerformanceCounterManager类的具体用法?C# IPerformanceCounterManager怎么用?C# IPerformanceCounterManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPerformanceCounterManager类属于命名空间,在下文中一共展示了IPerformanceCounterManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Connection
public Connection(IMessageBus newMessageBus,
JsonSerializer jsonSerializer,
string baseSignal,
string connectionId,
IList<string> signals,
IList<string> groups,
ILoggerFactory loggerFactory,
IAckHandler ackHandler,
IPerformanceCounterManager performanceCounterManager,
IProtectedData protectedData,
IMemoryPool pool)
{
if (loggerFactory == null)
{
throw new ArgumentNullException("loggerFactory");
}
_bus = newMessageBus;
_serializer = jsonSerializer;
_baseSignal = baseSignal;
_connectionId = connectionId;
_signals = new List<string>(signals.Concat(groups));
_groups = new DiffSet<string>(groups);
_logger = loggerFactory.CreateLogger<Connection>();
_ackHandler = ackHandler;
_counters = performanceCounterManager;
_protectedData = protectedData;
_excludeMessage = m => ExcludeMessage(m);
_pool = pool;
}
示例2: Connection
public Connection(IMessageBus newMessageBus,
IJsonSerializer jsonSerializer,
string baseSignal,
string connectionId,
IList<string> signals,
IList<string> groups,
ITraceManager traceManager,
IAckHandler ackHandler,
IPerformanceCounterManager performanceCounterManager,
IProtectedData protectedData)
{
if (traceManager == null)
{
throw new ArgumentNullException("traceManager");
}
_bus = newMessageBus;
_serializer = jsonSerializer;
_baseSignal = baseSignal;
_connectionId = connectionId;
_signals = new List<string>(signals.Concat(groups));
_groups = new DiffSet<string>(groups);
_traceSource = traceManager["SignalR.Connection"];
_ackHandler = ackHandler;
_counters = performanceCounterManager;
_protectedData = protectedData;
}
示例3: TransportDisconnectBase
protected TransportDisconnectBase(HostContext context, IJsonSerializer jsonSerializer, ITransportHeartbeat heartbeat, IPerformanceCounterManager performanceCounterManager, ITraceManager traceManager)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
if (jsonSerializer == null)
{
throw new ArgumentNullException("jsonSerializer");
}
if (heartbeat == null)
{
throw new ArgumentNullException("heartbeat");
}
if (performanceCounterManager == null)
{
throw new ArgumentNullException("performanceCounterManager");
}
if (traceManager == null)
{
throw new ArgumentNullException("traceManager");
}
_context = context;
_jsonSerializer = jsonSerializer;
_heartbeat = heartbeat;
_counters = performanceCounterManager;
_trace = traceManager["SignalR.Transports." + GetType().Name];
}
示例4: MessageBroker
public MessageBroker(ConcurrentDictionary<string, Topic> topics, IPerformanceCounterManager performanceCounterManager)
{
_topics = topics;
_counters = performanceCounterManager;
_timer = new Timer(_ => OnTimer(), state: null, dueTime: CheckWorkInterval, period: CheckWorkInterval);
}
示例5: ScaleoutSubscription
public ScaleoutSubscription(string identity,
IEnumerable<string> eventKeys,
string cursor,
ConcurrentDictionary<string, Linktionary<ulong, ScaleoutMapping>> streamMappings,
Func<MessageResult, Task<bool>> callback,
int maxMessages,
IPerformanceCounterManager counters)
: base(identity, eventKeys, callback, maxMessages, counters)
{
_streams = streamMappings;
IEnumerable<Cursor> cursors = null;
if (cursor == null)
{
cursors = from key in _streams.Keys
select new Cursor(key, GetCursorId(key));
}
else
{
cursors = Cursor.GetCursors(cursor);
}
_cursors = new List<Cursor>(cursors);
}
示例6: ScaleoutSubscription
public ScaleoutSubscription(string identity,
IList<string> eventKeys,
string cursor,
IList<ScaleoutMappingStore> stores,
Func<MessageResult, object, Task<bool>> callback,
int maxMessages,
IPerformanceCounterManager counters,
object state)
: base(identity, eventKeys, callback, maxMessages, counters, state)
{
if (stores == null)
{
throw new ArgumentNullException("stores");
}
_stores = stores;
List<Cursor> cursors = null;
if (String.IsNullOrEmpty(cursor))
{
cursors = new List<Cursor>(stores.Count);
for (int i = 0; i < stores.Count; i++)
{
cursors.Add(new Cursor(i.ToString(CultureInfo.InvariantCulture), stores[i].MaxKey));
}
}
else
{
cursors = Cursor.GetCursors(cursor);
}
_cursors = cursors;
}
示例7: RedisMessageBus
internal RedisMessageBus(IStringMinifier stringMinifier,
ILoggerFactory loggerFactory,
IPerformanceCounterManager performanceCounterManager,
IOptions<MessageBusOptions> optionsAccessor,
IOptions<RedisScaleoutOptions> scaleoutConfigurationAccessor,
IRedisConnection connection,
bool connectAutomatically)
: base(stringMinifier, loggerFactory, performanceCounterManager, optionsAccessor, scaleoutConfigurationAccessor)
{
_connectionString = scaleoutConfigurationAccessor.Options.ConnectionString;
_db = scaleoutConfigurationAccessor.Options.Database;
_key = scaleoutConfigurationAccessor.Options.EventKey;
_connection = connection;
_logger = loggerFactory.CreateLogger<RedisMessageBus>();
ReconnectDelay = TimeSpan.FromSeconds(2);
if (connectAutomatically)
{
ThreadPool.QueueUserWorkItem(_ =>
{
var ignore = ConnectWithRetry();
});
}
}
示例8: TransportDisconnectBase
protected TransportDisconnectBase(HostContext context, ITransportHeartbeat heartbeat, IPerformanceCounterManager performanceCounterManager, ITraceManager traceManager)
{
if (context == null)
{
throw new ArgumentNullException("context");
}
if (heartbeat == null)
{
throw new ArgumentNullException("heartbeat");
}
if (performanceCounterManager == null)
{
throw new ArgumentNullException("performanceCounterManager");
}
if (traceManager == null)
{
throw new ArgumentNullException("traceManager");
}
_context = context;
_heartbeat = heartbeat;
_counters = performanceCounterManager;
// Queue to protect against overlapping writes to the underlying response stream
WriteQueue = new TaskQueue();
_trace = traceManager["SignalR.Transports." + GetType().Name];
}
示例9: TransportDisconnectBase
public TransportDisconnectBase(HostContext context, IJsonSerializer jsonSerializer, ITransportHeartBeat heartBeat, IPerformanceCounterManager performanceCounterManager)
{
_context = context;
_jsonSerializer = jsonSerializer;
_heartBeat = heartBeat;
_counters = performanceCounterManager;
}
示例10: ScaleoutStreamManager
public ScaleoutStreamManager(Func<int, IList<Message>, Task> send,
Action<int, ulong, ScaleoutMessage> receive,
int streamCount,
TraceSource trace,
IPerformanceCounterManager performanceCounters,
ScaleoutConfiguration configuration)
{
if (configuration.QueueBehavior != QueuingBehavior.Disabled && configuration.MaxQueueLength == 0)
{
throw new InvalidOperationException(Resources.Error_ScaleoutQueuingConfig);
}
_streams = new ScaleoutStream[streamCount];
_send = send;
_receive = receive;
var receiveMapping = new ScaleoutMappingStore[streamCount];
performanceCounters.ScaleoutStreamCountTotal.RawValue = streamCount;
performanceCounters.ScaleoutStreamCountBuffering.RawValue = streamCount;
performanceCounters.ScaleoutStreamCountOpen.RawValue = 0;
for (int i = 0; i < streamCount; i++)
{
_streams[i] = new ScaleoutStream(trace, "Stream(" + i + ")", configuration.QueueBehavior, configuration.MaxQueueLength, performanceCounters);
receiveMapping[i] = new ScaleoutMappingStore();
}
Streams = new ReadOnlyCollection<ScaleoutMappingStore>(receiveMapping);
}
示例11: ScaleoutStreamManager
public ScaleoutStreamManager(Func<int, IList<Message>, Task> send,
Action<int, ulong, ScaleoutMessage> receive,
int streamCount,
TraceSource trace,
IPerformanceCounterManager performanceCounters,
ScaleoutConfiguration configuration)
{
_streams = new ScaleoutStream[streamCount];
_send = send;
_receive = receive;
var receiveMapping = new ScaleoutMappingStore[streamCount];
performanceCounters.ScaleoutStreamCountTotal.RawValue = streamCount;
performanceCounters.ScaleoutStreamCountBuffering.RawValue = streamCount;
performanceCounters.ScaleoutStreamCountOpen.RawValue = 0;
for (int i = 0; i < streamCount; i++)
{
_streams[i] = new ScaleoutStream(trace, "Stream(" + i + ")", configuration.MaxQueueLength, performanceCounters);
receiveMapping[i] = new ScaleoutMappingStore();
}
Streams = new ReadOnlyCollection<ScaleoutMappingStore>(receiveMapping);
}
示例12: SqlMessageBus
/// <summary>
/// Creates a new instance of the SqlMessageBus class.
/// </summary>
/// <param name="resolver">The resolver to use.</param>
/// <param name="configuration">The SQL scale-out configuration options.</param>
public SqlMessageBus(IStringMinifier stringMinifier,
ILoggerFactory loggerFactory,
IPerformanceCounterManager performanceCounterManager,
IOptions<MessageBusOptions> optionsAccessor,
IOptions<SqlScaleoutOptions> scaleoutOptionsAccessor)
: this(stringMinifier, loggerFactory, performanceCounterManager, optionsAccessor, scaleoutOptionsAccessor, SqlClientFactory.Instance.AsIDbProviderFactory())
{
}
示例13: WebSocketTransport
public WebSocketTransport(HostContext context,
IJsonSerializer serializer,
ITransportHeartBeat heartBeat,
IPerformanceCounterManager performanceCounterWriter)
: base(context, serializer, heartBeat, performanceCounterWriter)
{
_context = context;
}
示例14: GetPerformanceCounters
protected override IPerformanceCounter[] GetPerformanceCounters(IPerformanceCounterManager counterManager)
{
if (RunData.Host != "External")
{
return base.GetPerformanceCounters(counterManager);
}
return new IPerformanceCounter[0];
}
示例15: ForeverTransport
public ForeverTransport(HostContext context,
IJsonSerializer jsonSerializer,
ITransportHeartBeat heartBeat,
IPerformanceCounterManager performanceCounterWriter)
: base(context, jsonSerializer, heartBeat, performanceCounterWriter)
{
_jsonSerializer = jsonSerializer;
_counters = performanceCounterWriter;
}