Esempio n. 1
0
        public void LinearBucketingRule_DeterminesCorrectValue()
        {
            var rule = new LinearBucketingRule(10d, 0d, 1000d);

            Assert.AreEqual(0d, rule.DetermineValue(0));
            Assert.AreEqual(10d, rule.DetermineValue(1));
            Assert.AreEqual(100d, rule.DetermineValue(10));
        }
Esempio n. 2
0
        private static void Display(LinearBucketingRule rule, Histogram histogram, bool cumulative)
        {
            var total = 0;
            Console.WriteLine("Low (< " + rule.Min + ") \t" + histogram.Low);
            for(int i = 0; i < histogram.Buckets.Length; i++)
            {
                total += histogram.Buckets[i];
                if (cumulative)
                {
                    Console.WriteLine(rule.DetermineValue(i) + "\t" + total);
                }
                else
                {
                    Console.WriteLine(rule.DetermineValue(i) + "\t" + histogram.Buckets[i]);
                }

            }
            Console.WriteLine("High (>= " + rule.Max + ") \t" + histogram.High);
            total += histogram.Low + histogram.High;
            Console.WriteLine("Total\t" + total);
        }