Example #1
0
        public virtual void TestCounterIteratorConcurrency()
        {
            Counters counters = new Counters();

            counters.IncrCounter("group1", "counter1", 1);
            IEnumerator <Counters.Group> iterator = counters.GetEnumerator();

            counters.IncrCounter("group2", "counter2", 1);
            iterator.Next();
        }
Example #2
0
        private void ValidateCounters(Counters counters)
        {
            IEnumerator <CounterGroup> it = counters.GetEnumerator();

            while (it.HasNext())
            {
                CounterGroup group = it.Next();
                Log.Info("Group " + group.GetDisplayName());
                IEnumerator <Counter> itc = group.GetEnumerator();
                while (itc.HasNext())
                {
                    Log.Info("Counter is " + itc.Next().GetDisplayName());
                }
            }
            NUnit.Framework.Assert.AreEqual(1, counters.CountCounters());
        }