Exemplo n.º 1
0
        static IDisposable?InitMetricsAndViz(
            IEnumerable <HostConfig> configObj,
            IObservable <NetInfo> netInfo,
            bool usePrometheus = true,
            bool noConsole     = false)
        {
            var reports = CheckerBuilder.Build(configObj);

            if (usePrometheus)
            {
                PrometheusPublisher.SetReportSource(reports);
            }

            IDisposable?vizSubscription = null;

            if (!noConsole)
            {
                var viz = new VizEngine(reports, netInfo);
                vizSubscription = viz.Frames
                                  .Subscribe(frame => {
                    Console.Clear();
                    System.Console.WriteLine(frame);
                });
            }

            reports.Connect();
            return(vizSubscription);
        }
Exemplo n.º 2
0
        public void BuildSimplePropertyChecker()
        {
            var builder = new CheckerBuilder(CheckerFactory);

            var checker = (ICheckerCompare)builder.Build(typeof(Fred));

            Assert.AreEqual(1, checker.Properties.Count, "Property count differs");
        }
        public void BuildDescendantPropertyChecker()
        {
            var builder = new CheckerBuilder(this.CheckerFactory);

            var checker = (ICheckerCompare)builder.Build(typeof(Jim));

            Assert.AreEqual(1, checker.Properties.Count, "Property count differs");
        }
Exemplo n.º 4
0
        private void CheckProperty <T>(string name, CompareTarget expected)
        {
            var builder  = new CheckerBuilder(CheckerFactory);
            var checker  = (Checker <T>)builder.Build(typeof(T));
            var property = checker[name];

            Assert.AreEqual(expected, property.CompareTarget);
        }