当前位置: 首页>>代码示例>>C#>>正文


C# Histogram.getTotalCount方法代码示例

本文整理汇总了C#中Histogram.getTotalCount方法的典型用法代码示例。如果您正苦于以下问题:C# Histogram.getTotalCount方法的具体用法?C# Histogram.getTotalCount怎么用?C# Histogram.getTotalCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Histogram的用法示例。


在下文中一共展示了Histogram.getTotalCount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: testRawRecordingSpeed

        public void testRawRecordingSpeed()
        {
            AbstractHistogram histogram;
            histogram = new Histogram(highestTrackableValue, numberOfSignificantValueDigits);
            Console.WriteLine("\n\nTiming Histogram:");
            testRawRecordingSpeedAtExpectedInterval("Histogram: ", histogram, 1000000000, rawtimingLoopCount);

            // Check that the histogram contains as many values are we wrote to it
            Assert.AreEqual(rawtimingLoopCount, histogram.getTotalCount());
        }
开发者ID:elfchief,项目名称:HdrHistogram,代码行数:10,代码来源:HistogramPerfTest.cs

示例2: testReset

 public void testReset()  
 {
     Histogram histogram = new Histogram(highestTrackableValue, numberOfSignificantValueDigits);
     histogram.recordValue(testValueLevel);
     histogram.reset();
     Assert.assertEquals(0L, histogram.getCountAtValue(testValueLevel));
     Assert.assertEquals(0L, histogram.getTotalCount());
 }
开发者ID:elfchief,项目名称:HdrHistogram,代码行数:8,代码来源:HistogramTest.cs

示例3: testAdd

        public void testAdd()  
        {
            Histogram histogram = new Histogram(highestTrackableValue, numberOfSignificantValueDigits);
            Histogram other = new Histogram(highestTrackableValue, numberOfSignificantValueDigits);
            histogram.recordValue(testValueLevel);
            histogram.recordValue(testValueLevel * 1000);
            other.recordValue(testValueLevel);
            other.recordValue(testValueLevel * 1000);
            histogram.add(other);
            Assert.assertEquals(2L, histogram.getCountAtValue(testValueLevel));
            Assert.assertEquals(2L, histogram.getCountAtValue(testValueLevel * 1000));
            Assert.assertEquals(4L, histogram.getTotalCount());

            Histogram biggerOther = new Histogram(highestTrackableValue * 2, numberOfSignificantValueDigits);
            biggerOther.recordValue(testValueLevel);
            biggerOther.recordValue(testValueLevel * 1000);

            // Adding the smaller histogram to the bigger one should work:
            biggerOther.add(histogram);
            Assert.assertEquals(3L, biggerOther.getCountAtValue(testValueLevel));
            Assert.assertEquals(3L, biggerOther.getCountAtValue(testValueLevel * 1000));
            Assert.assertEquals(6L, biggerOther.getTotalCount());

            // But trying to add a larger histogram into a smaller one should throw an AIOOB:
            bool thrown = false;
            try 
            {
                // This should throw:
                histogram.add(biggerOther);
            }
            catch (ArgumentOutOfRangeException)
            {
                thrown = true;
            }
            Assert.assertTrue(thrown);
        }
开发者ID:elfchief,项目名称:HdrHistogram,代码行数:36,代码来源:HistogramTest.cs

示例4: testRecordValueWithExpectedInterval

 public void testRecordValueWithExpectedInterval()  
 {
     Histogram histogram = new Histogram(highestTrackableValue, numberOfSignificantValueDigits);
     histogram.recordValueWithExpectedInterval(testValueLevel, testValueLevel/4);
     Histogram rawHistogram = new Histogram(highestTrackableValue, numberOfSignificantValueDigits);
     rawHistogram.recordValue(testValueLevel);
     // The data will include corrected samples:
     Assert.assertEquals(1L, histogram.getCountAtValue((testValueLevel * 1 )/4));
     Assert.assertEquals(1L, histogram.getCountAtValue((testValueLevel * 2 )/4));
     Assert.assertEquals(1L, histogram.getCountAtValue((testValueLevel * 3 )/4));
     Assert.assertEquals(1L, histogram.getCountAtValue((testValueLevel * 4 )/4));
     Assert.assertEquals(4L, histogram.getTotalCount());
     // But the raw data will not:
     Assert.assertEquals(0L, rawHistogram.getCountAtValue((testValueLevel * 1 )/4));
     Assert.assertEquals(0L, rawHistogram.getCountAtValue((testValueLevel * 2 )/4));
     Assert.assertEquals(0L, rawHistogram.getCountAtValue((testValueLevel * 3 )/4));
     Assert.assertEquals(1L, rawHistogram.getCountAtValue((testValueLevel * 4 )/4));
     Assert.assertEquals(1L, rawHistogram.getTotalCount());
 }
开发者ID:elfchief,项目名称:HdrHistogram,代码行数:19,代码来源:HistogramTest.cs


注:本文中的Histogram.getTotalCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。