本文整理汇总了C#中IPerformanceCounterManager类的典型用法代码示例。如果您正苦于以下问题:C# IPerformanceCounterManager类的具体用法?C# IPerformanceCounterManager怎么用?C# IPerformanceCounterManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPerformanceCounterManager类属于命名空间,在下文中一共展示了IPerformanceCounterManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:leloulight,项目名称:SignalR-Server,代码行数:30,代码来源:Connection.cs
示例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;
}
开发者ID:Djohnnie,项目名称:Sonarr,代码行数:27,代码来源:Connection.cs
示例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];
}
开发者ID:kppullin,项目名称:SignalR,代码行数:34,代码来源:TransportDisconnectBase.cs
示例4: MessageBroker
public MessageBroker(ConcurrentDictionary<string, Topic> topics, IPerformanceCounterManager performanceCounterManager)
{
_topics = topics;
_counters = performanceCounterManager;
_timer = new Timer(_ => OnTimer(), state: null, dueTime: CheckWorkInterval, period: CheckWorkInterval);
}
开发者ID:jonfancey,项目名称:SharePointSignalR,代码行数:7,代码来源:MessageBroker.cs
示例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);
}
开发者ID:nonintanon,项目名称:SignalR,代码行数:25,代码来源:ScaleoutSubscription.cs
示例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;
}
开发者ID:armandoramirezdino,项目名称:SignalR,代码行数:34,代码来源:ScaleoutSubscription.cs
示例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();
});
}
}
开发者ID:okusnadi,项目名称:SignalR-Redis,代码行数:27,代码来源:RedisMessageBus.cs
示例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];
}
开发者ID:Choulla-Naresh8264,项目名称:SignalR,代码行数:31,代码来源:TransportDisconnectBase.cs
示例9: TransportDisconnectBase
public TransportDisconnectBase(HostContext context, IJsonSerializer jsonSerializer, ITransportHeartBeat heartBeat, IPerformanceCounterManager performanceCounterManager)
{
_context = context;
_jsonSerializer = jsonSerializer;
_heartBeat = heartBeat;
_counters = performanceCounterManager;
}
开发者ID:ntcnet83,项目名称:SignalR,代码行数:7,代码来源:TransportDisconnectBase.cs
示例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);
}
开发者ID:GaneshBachhao,项目名称:SignalR,代码行数:30,代码来源:ScaleoutStreamManager.cs
示例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);
}
开发者ID:Djohnnie,项目名称:Sonarr,代码行数:25,代码来源:ScaleoutStreamManager.cs
示例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())
{
}
开发者ID:andyshao,项目名称:SignalR-SqlServer,代码行数:13,代码来源:SqlMessageBus.cs
示例13: WebSocketTransport
public WebSocketTransport(HostContext context,
IJsonSerializer serializer,
ITransportHeartBeat heartBeat,
IPerformanceCounterManager performanceCounterWriter)
: base(context, serializer, heartBeat, performanceCounterWriter)
{
_context = context;
}
开发者ID:TSASoftware,项目名称:SignalR,代码行数:8,代码来源:WebSocketTransport.cs
示例14: GetPerformanceCounters
protected override IPerformanceCounter[] GetPerformanceCounters(IPerformanceCounterManager counterManager)
{
if (RunData.Host != "External")
{
return base.GetPerformanceCounters(counterManager);
}
return new IPerformanceCounter[0];
}
开发者ID:GaneshBachhao,项目名称:SignalR,代码行数:9,代码来源:HostedRun.cs
示例15: ForeverTransport
public ForeverTransport(HostContext context,
IJsonSerializer jsonSerializer,
ITransportHeartBeat heartBeat,
IPerformanceCounterManager performanceCounterWriter)
: base(context, jsonSerializer, heartBeat, performanceCounterWriter)
{
_jsonSerializer = jsonSerializer;
_counters = performanceCounterWriter;
}
开发者ID:nonintanon,项目名称:SignalR,代码行数:9,代码来源:ForeverTransport.cs
示例16: MessageBus
public MessageBus(IStringMinifier stringMinifier,
ILoggerFactory loggerFactory,
IPerformanceCounterManager performanceCounterManager,
IOptions<MessageBusOptions> optionsAccessor)
{
if (stringMinifier == null)
{
throw new ArgumentNullException("stringMinifier");
}
if (loggerFactory == null)
{
throw new ArgumentNullException("traceManager");
}
if (performanceCounterManager == null)
{
throw new ArgumentNullException("performanceCounterManager");
}
if (optionsAccessor == null)
{
throw new ArgumentNullException("optionsAccessor");
}
var options = optionsAccessor.Options;
if (options.MessageBufferSize < 0)
{
throw new ArgumentOutOfRangeException(Resources.Error_BufferSizeOutOfRange);
}
_stringMinifier = stringMinifier;
_loggerFactory = loggerFactory;
Counters = performanceCounterManager;
_logger = _loggerFactory.CreateLogger<MessageBus>();
_maxTopicsWithNoSubscriptions = options.MaxTopicsWithNoSubscriptions;
_gcTimer = new Timer(_ => GarbageCollectTopics(), state: null, dueTime: _gcInterval, period: _gcInterval);
_broker = new MessageBroker(Counters)
{
Logger = _logger
};
// The default message store size
_messageStoreSize = (uint)options.MessageBufferSize;
_topicTtl = options.TopicTTL;
_createTopic = CreateTopic;
_addEvent = AddEvent;
_removeEvent = RemoveEvent;
_disposeSubscription = o => DisposeSubscription(o);
Topics = new TopicLookup();
}
开发者ID:eduaglz,项目名称:SignalR-Server,代码行数:56,代码来源:MessageBus.cs
示例17: LongPollingTransport
public LongPollingTransport(HostContext context,
JsonSerializer jsonSerializer,
ITransportHeartbeat heartbeat,
IPerformanceCounterManager performanceCounterManager,
ITraceManager traceManager,
IConfigurationManager configurationManager)
: base(context, jsonSerializer, heartbeat, performanceCounterManager, traceManager)
{
_configurationManager = configurationManager;
}
开发者ID:GaneshBachhao,项目名称:SignalR,代码行数:10,代码来源:LongPollingTransport.cs
示例18: ForeverTransport
protected ForeverTransport(HostContext context,
JsonSerializer jsonSerializer,
ITransportHeartbeat heartbeat,
IPerformanceCounterManager performanceCounterWriter,
ITraceManager traceManager)
: base(context, heartbeat, performanceCounterWriter, traceManager)
{
_jsonSerializer = jsonSerializer;
_counters = performanceCounterWriter;
}
开发者ID:RyanChristensen,项目名称:SignalR,代码行数:10,代码来源:ForeverTransport.cs
示例19: LongPollingTransport
public LongPollingTransport(HostContext context,
IJsonSerializer jsonSerializer,
ITransportHeartbeat heartbeat,
IPerformanceCounterManager performanceCounterManager,
ITraceManager traceManager)
: base(context, heartbeat, performanceCounterManager, traceManager)
{
_jsonSerializer = jsonSerializer;
_counters = performanceCounterManager;
}
开发者ID:bjarteskogoy,项目名称:SignalR,代码行数:10,代码来源:LongPollingTransport.cs
示例20: TestLongPollingTransport
private TestLongPollingTransport(
HostContext context,
JsonSerializer json,
ITransportHeartbeat heartBeat,
IPerformanceCounterManager counters,
ITraceManager traceManager,
IConfigurationManager configuarionManager)
: base(context, json, heartBeat, counters, traceManager, configuarionManager)
{
}
开发者ID:GondhiDinesh,项目名称:SignalR,代码行数:10,代码来源:LongPollingTransportFacts.cs
注:本文中的IPerformanceCounterManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论