コード例 #1
0
        public static BuiltComponents Build(SimpleProcessElement simpleConfig)
        {
            var counterElement = new ProcessElement(simpleConfig);
            var sourceConfig = new ProcessCountingSourceConfiguration(new[] { counterElement });
            var source = ProcessCountingSourceBuilder.Build(sourceConfig);

            return SimpleComponentBuilder.BuildStandardSinkSet(simpleConfig, source);
        }
コード例 #2
0
        public static IEnumerable<ISnapshotProvider> Build(ProcessCountingSourceConfiguration processCountingSourceConfiguration)
        {
            var processCountingSources = new List<ISnapshotProvider>();

            foreach (ProcessElement config in processCountingSourceConfiguration.Processes)
            {
                processCountingSources.Add(new ProcessCountingSource(config));
            }

            return processCountingSources;
        }
コード例 #3
0
        public void CanBuildSourceFromConfiguration()
        {
            var name = "testSource";

            var configs = new[]
                {
                    new ProcessElement("id", name, "exe", "machine")
                };

            var configCollection = new ProcessCountingSourceConfiguration(configs);

            var sources = ProcessCountingSourceBuilder.Build(configCollection);

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