コード例 #1
0
        public override async Task <bool> InvokeAsync(string paramList)
        {
            var config        = _configBusiness.LoadFiles(new string[] { });
            var counterGroups = _publisherBusiness.GetCounterPublishers(config).ToArray();

            var index            = 0;
            var counterPublisher = QueryParam("Counter", GetParam(paramList, index++), counterGroups.Select(x => new KeyValuePair <ICounterPublisher, string>(x, x.CounterName)));

            var processor = new Processor(_configBusiness, _counterBusiness, _publisherBusiness, _sendBusiness, _tagLoader);

            processor.EngineActionEvent += EngineActionEvent;

            //if (counterPublisher == null)
            //{
            //    if (!processor.RunAsync(new string[] { }).Wait(5000))
            //    {
            //        throw new InvalidOperationException("Unable to start processor engine.");
            //    }
            //}
            //else
            //{
            var counterPublishers = new[] { counterPublisher };
            await processor.RunAsync(null, counterPublishers, config.Application.Metadata);

            //}

            return(true);
        }
コード例 #2
0
        public async Task RunAsync(string[] configFileNames)
        {
            var config            = _configBusiness.LoadFiles(configFileNames);
            var counterGroups     = _counterBusiness.GetPerformanceCounterGroups(config).ToArray();
            var counterPublishers = _publisherBusiness.GetCounterPublishers(config).ToArray();

            await RunAsync(counterGroups, counterPublishers, config.Application.Metadata);
        }