コード例 #1
0
        public virtual void TestLegacyGetGroupNames()
        {
            Counters counters = new Counters();

            // create 2 filesystem counter groups
            counters.FindCounter("fs1", FileSystemCounter.BytesRead).Increment(1);
            counters.FindCounter("fs2", FileSystemCounter.BytesRead).Increment(1);
            counters.IncrCounter("group1", "counter1", 1);
            HashSet <string> groups = new HashSet <string>(((ICollection <string>)counters.GetGroupNames
                                                                ()));
            HashSet <string> expectedGroups = new HashSet <string>();

            expectedGroups.AddItem("group1");
            expectedGroups.AddItem("FileSystemCounters");
            //Legacy Name
            expectedGroups.AddItem("org.apache.hadoop.mapreduce.FileSystemCounter");
            NUnit.Framework.Assert.AreEqual(expectedGroups, groups);
        }