Exemple #1
0
        public virtual void TestFilesystemCounter()
        {
            Counters.GroupFactory groupFactory = new GroupFactoryForTest();
            Counters.Group        fsGroup      = groupFactory.NewFileSystemGroup();
            Counter count1 = fsGroup.FindCounter("ANY_BYTES_READ");

            NUnit.Framework.Assert.IsNotNull(count1);
            // Verify no exception get thrown when finding an unknown counter
            Counter count2 = fsGroup.FindCounter("Unknown");

            NUnit.Framework.Assert.IsNull(count2);
        }
Exemple #2
0
        public virtual void TestFrameworkCounter()
        {
            Counters.GroupFactory groupFactory = new GroupFactoryForTest();
            CounterGroupFactory.FrameworkGroupFactory frameworkGroupFactory = groupFactory.NewFrameworkGroupFactory
                                                                              <JobCounter>();
            Counters.Group group = (Counters.Group)frameworkGroupFactory.NewGroup("JobCounter"
                                                                                  );
            FrameworkCounterGroup counterGroup = (FrameworkCounterGroup)group.GetUnderlyingGroup
                                                     ();
            Counter count1 = counterGroup.FindCounter(JobCounter.NumFailedMaps.ToString());

            NUnit.Framework.Assert.IsNotNull(count1);
            // Verify no exception get thrown when finding an unknown counter
            Counter count2 = counterGroup.FindCounter("Unknown");

            NUnit.Framework.Assert.IsNull(count2);
        }