Пример #1
0
        /// <exception cref="System.Exception"/>
        private static void VerifyGroupMetrics(long groups)
        {
            MetricsRecordBuilder rb = MetricsAsserts.GetMetrics("UgiMetrics");

            if (groups > 0)
            {
                MetricsAsserts.AssertCounterGt("GetGroupsNumOps", groups - 1, rb);
                double avg = MetricsAsserts.GetDoubleGauge("GetGroupsAvgTime", rb);
                Assert.True(avg >= 0.0);
                // Sleep for an interval+slop to let the percentiles rollover
                Thread.Sleep((PercentilesInterval + 1) * 1000);
                // Check that the percentiles were updated
                MetricsAsserts.AssertQuantileGauges("GetGroups1s", rb);
            }
        }