Ejemplo n.º 1
0
 public CollectorEngine(IPerformanceCounterGroup performanceCounterGroup, ISendBusiness sendBusiness, ITagLoader tagLoader)
 {
     _performanceCounterGroup = performanceCounterGroup;
     _sendBusiness = sendBusiness;
     _tags = tagLoader.GetGlobalTags().Union(_performanceCounterGroup.Tags).ToArray();
     if (performanceCounterGroup.SecondsInterval > 0)
     {
         _timer = new Timer(1000 * performanceCounterGroup.SecondsInterval);
         _timer.Elapsed += Elapsed;
     }
     _name = _performanceCounterGroup.Name;
 }
Ejemplo n.º 2
0
        public PublisherEngine(ICounterPublisher counterPublisher, ISendBusiness sendBusiness, ITagLoader tagLoader)
        {
            _counterPublisher = counterPublisher;
            _sendBusiness = sendBusiness;
            _tags = tagLoader.GetGlobalTags(); //.Union(_performanceCounterGroup.Tags).ToArray();

            if (counterPublisher.SecondsInterval > 0)
            {
                _timer = new Timer(1000 * counterPublisher.SecondsInterval);
                _timer.Elapsed += Elapsed;
            }

            _perfCounter = SetupCategory();
            //_perfCounter = new PerformanceCounter(_counterPublisher.CategoryName, _counterPublisher.CounterName, false) { RawValue = _counterPublisher.GetValue() };
        }
Ejemplo n.º 3
0
        public PublisherEngine(ICounterPublisher counterPublisher, ISendBusiness sendBusiness, ITagLoader tagLoader)
        {
            _counterPublisher = counterPublisher;
            _sendBusiness     = sendBusiness;
            _tags             = tagLoader.GetGlobalTags(); //.Union(_performanceCounterGroup.Tags).ToArray();

            if (counterPublisher.SecondsInterval > 0)
            {
                _timer          = new Timer(1000 * counterPublisher.SecondsInterval);
                _timer.Elapsed += Elapsed;
            }

            _perfCounter = SetupCategory();
            //_perfCounter = new PerformanceCounter(_counterPublisher.CategoryName, _counterPublisher.CounterName, false) { RawValue = _counterPublisher.GetValue() };
        }
        protected CollectorEngineBase(IPerformanceCounterGroup performanceCounterGroup, ISendBusiness sendBusiness, ITagLoader tagLoader, bool metadata)
        {
            _engineName = GetType().Name;
            _performanceCounterGroup = performanceCounterGroup;
            _name         = _performanceCounterGroup.Name;
            _sendBusiness = sendBusiness;
            _tags         = tagLoader.GetGlobalTags().Union(_performanceCounterGroup.Tags).ToArray();

            if (performanceCounterGroup.SecondsInterval > 0)
            {
                _timer          = new Timer(1000 * performanceCounterGroup.SecondsInterval);
                _timer.Elapsed += Elapsed;
            }

            _metadata = metadata;
        }
Ejemplo n.º 5
0
        protected CollectorEngineBase(IPerformanceCounterGroup performanceCounterGroup, ISendBusiness sendBusiness, ITagLoader tagLoader, bool metadata)
        {
            _engineName = GetType().Name;
            _performanceCounterGroup = performanceCounterGroup;
            _name = _performanceCounterGroup.Name;
            _sendBusiness = sendBusiness;
            _tags = tagLoader.GetGlobalTags().Union(_performanceCounterGroup.Tags).ToArray();

            if (performanceCounterGroup.SecondsInterval > 0)
            {
                _timer = new Timer(1000 * performanceCounterGroup.SecondsInterval);
                _timer.Elapsed += Elapsed;
            }

            _metadata = metadata;
        }