public static BuiltComponents Build(SimpleCounterElement simpleConfig)
        {
            var counterElement = new CounterElement(simpleConfig);
            var sourceConfig = new PerformanceCounterDataSourceConfiguration(new[] { counterElement });
            var source = PerformanceCounterDataSourceBuilder.Build(sourceConfig);

            return SimpleComponentBuilder.BuildStandardSinkSet(simpleConfig, source);
        }
        public static IEnumerable<ISnapshotProvider> Build(PerformanceCounterDataSourceConfiguration performanceCounterSourceConfiguration)
        {
            var performanceCounterDataSinks = new List<ISnapshotProvider>();

            foreach (CounterElement config in performanceCounterSourceConfiguration.Counters)
            {
                performanceCounterDataSinks.Add(new PerformanceCounterDataSource(config));
            }

            return performanceCounterDataSinks;
        }
        public void CanBuildWhenGivenConfiguration()
        {
            var name = "testSource";

            var configs = new[]
                {
                    new CounterElement("id", name, "category", "counter", "instance", "machine")
                };

            var configCollection = new PerformanceCounterDataSourceConfiguration(configs);

            var sources = PerformanceCounterDataSourceBuilder.Build(configCollection);

            Assert.AreEqual(1, sources.Count());
            Assert.AreEqual(name, sources.First().Name);
        }