コード例 #1
0
        public void TestDefaults()
        {
            var    q = new SampleStream(Invariants.Targeted(new[] { new QuantileEpsilonPair(0.99d, 0.001d) }));
            double g = q.Query(0.99);

            Assert.Equal(double.NaN, g);
        }
コード例 #2
0
        public void TestUncompressedOne()
        {
            var q = new SampleStream(Invariants.Targeted(new[] { new QuantileEpsilonPair(0.99d, 0.001d) }));

            q.InsertRange(new[] { 3.14 });
            double g = q.Query(0.90);

            Assert.Equal(3.14, g);
        }
コード例 #3
0
        public void TestTargetedQuery(double quantile, double epsilon, double[] data)
        {
            Array.Sort(data);
            var targets = new[] { new QuantileEpsilonPair(quantile, epsilon) };

            var s = new SampleStream(Invariants.Targeted(targets));

            s.InsertRange(data);

            VerifyPercsWithAbsoluteEpsilon(data, s, targets);
        }
コード例 #4
0
        public Summary(SummaryConfiguration configuration, IReadOnlyList <string> labels, Func <DateTimeOffset> currentTimeProvider = null)
            : base(configuration, labels, currentTimeProvider)
        {
            var streamDuration = new TimeSpan(Configuration.MaxAge.Ticks / Configuration.AgeBuckets);

            _quantileStream = new QuantileStream(
                Configuration.BufCap,
                streamDuration,
                configuration.AgeBuckets,
                Invariants.Targeted(Configuration.Objectives),
                currentTimeProvider);
        }