Exemplo n.º 1
0
        public WordTransformerWithMonitor(
            ITransformationTraversalWithMonitor traversal,
            ITransformationNodeFactory nodeFactory,
            IWordModulator wordModulator,
            IMonitorFactory monitorFactory)
            : base(traversal, nodeFactory, wordModulator)
        {
            if (monitorFactory == null)
            {
                throw new ArgumentNullException(nameof(monitorFactory));
            }

            this.generatedWordsCounter = monitorFactory.OpenPerformanceCounter("New Words per Word");
            this.processedNodesCounter = monitorFactory.OpenPerformanceCounter("New Words per Word - Base");
        }
Exemplo n.º 2
0
        public WordDictionaryWithMonitor(IWordDictionary core, IMonitorFactory monitorFactory)
        {
            if (core == null)
            {
                throw new ArgumentNullException(nameof(core));
            }
            if (monitorFactory == null)
            {
                throw new ArgumentNullException(nameof(monitorFactory));
            }

            this.core = core;

            this.wordTestCount = monitorFactory.OpenPerformanceCounter("Word Hit Ratio - Base");
            this.wordHitCount  = monitorFactory.OpenPerformanceCounter("Word Hit Ratio");
        }
        public TransformationTraversalWithMonitor(ITransformationTraversal core, IMonitorFactory monitorFactory)
        {
            if (core == null)
            {
                throw new ArgumentNullException(nameof(core));
            }
            if (monitorFactory == null)
            {
                throw new ArgumentNullException(nameof(monitorFactory));
            }

            this.core = core;

            this.backlogCount    = monitorFactory.OpenPerformanceCounter("Traversal Backlog");
            this.rateOfEmbark    = monitorFactory.OpenPerformanceCounter("Traversal Embark per Second");
            this.rateOfDisembark = monitorFactory.OpenPerformanceCounter("Traversal Disembark per Second");
        }