Esempio n. 1
0
        internal static Counters GetMyCounters()
        {
            Counter counter = recordFactory.NewRecordInstance <Counter>();

            counter.SetName("Mycounter");
            counter.SetDisplayName("My counter display name");
            counter.SetValue(12345);
            CounterGroup group = recordFactory.NewRecordInstance <CounterGroup>();

            group.SetName("MyGroup");
            group.SetDisplayName("My groupd display name");
            group.SetCounter("myCounter", counter);
            Counters counters = recordFactory.NewRecordInstance <Counters>();

            counters.SetCounterGroup("myGroupd", group);
            return(counters);
        }
Esempio n. 2
0
        private GetCountersResponse GetCountersResponseFromHistoryServer()
        {
            GetCountersResponse countersResponse = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord
                                                   <GetCountersResponse>();
            Counter      counter      = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <Counter>();
            CounterGroup counterGroup = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <CounterGroup
                                                                                       >();
            Counters counters = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <Counters>();

            counter.SetDisplayName("dummyCounter");
            counter.SetName("dummyCounter");
            counter.SetValue(1001);
            counterGroup.SetName("dummyCounters");
            counterGroup.SetDisplayName("dummyCounters");
            counterGroup.SetCounter("dummyCounter", counter);
            counters.SetCounterGroup("dummyCounters", counterGroup);
            countersResponse.SetCounters(counters);
            return(countersResponse);
        }