当前位置: 首页>>代码示例>>C#>>正文


C# IPerformanceCounterManager类代码示例

本文整理汇总了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;
        }
开发者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


注:本文中的IPerformanceCounterManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。