void OnIntervalChange(long IntervalDuration)
        {
            SelectedInterval       = IntervalFilter.GetIntervalFilters().Where(i => i.Duration == IntervalDuration).FirstOrDefault();
            SelectedFilterInterval = IntervalDuration;

            FilterCurrentChartData(IntervalDuration);
        }
Пример #2
0
        public void Constructor_WithSingleInterval_PropertiesAreSet()
        {
            var filter = new IntervalFilter(TestDimension, TestIntervalA);

            Assert.That(filter.Dimension, Is.EqualTo(TestDimension));
            Assert.That(filter.Intervals.Count, Is.EqualTo(1));
            Assert.That(filter.Intervals[0], Is.EqualTo(TestIntervalA.ToInterval()));
        }
Пример #3
0
        public void Constructor_WithManyEnumerableIntervals_PropertiesAreSet()
        {
            var filter = new IntervalFilter(TestDimension, new [] { TestIntervalA, TestIntervalB });

            Assert.That(filter.Dimension, Is.EqualTo(TestDimension));
            Assert.That(filter.Intervals.Count, Is.EqualTo(2));
            Assert.That(filter.Intervals[0], Is.EqualTo(TestIntervalA.ToInterval()));
            Assert.That(filter.Intervals[1], Is.EqualTo(TestIntervalB.ToInterval()));
        }
Пример #4
0
        /**
         * <summary>Gets the text strings matching the specified intervals.</summary>
         * <param name="textStrings">Text strings to filter.</param>
         * <param name="intervals">Text intervals to match. They MUST be ordered and not overlapping.</param>
         * <returns>A list of text strings corresponding to the specified intervals.</returns>
         */
        public IList <ITextString> Filter(
            IDictionary <RectangleF?, IList <ITextString> > textStrings,
            IList <Interval <int> > intervals
            )
        {
            IntervalFilter filter = new IntervalFilter(intervals);

            Filter(textStrings, filter);
            return(filter.TextStrings);
        }
Пример #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SelectableLogMessageFilter{TMessage}"/> class.
 /// </summary>
 protected SelectableLogMessageFilterBase()
 {
     TimestampFilter       = new IntervalFilter(this);
     LogWriterFilter       = new ItemFilter <string>(this, "", StringComparer.OrdinalIgnoreCase);
     LogLevelFilter        = new ItemFilter <string>(this, AspectLogLevelGroup, StringComparer.OrdinalIgnoreCase);
     TagFilter             = new ItemFilter <string>(this, "", StringComparer.OrdinalIgnoreCase);
     ApplicationNameFilter = new ItemFilter <string>(this, "", StringComparer.OrdinalIgnoreCase);
     ProcessNameFilter     = new ItemFilter <string>(this, "", StringComparer.OrdinalIgnoreCase);
     ProcessIdFilter       = new ItemFilter <int>(this, "", Comparer <int> .Default);
     TextFilter            = new FulltextFilter(this);
 }
        protected override void OnInitialized()
        {
            SelectedInterval         = IntervalFilter.GetIntervalFilters()[3];
            SelectedFilterInterval   = IntervalFilter.GetIntervalFilters()[3].Duration;
            ActiveTimeFilterDuration = TimeFilter.GetFilters()[4].Duration;

            Start = End.AddDays(-4);
            FilterIntervals(ActiveTimeFilterDuration.Value);

            TimeFilters.Add(new TimeFilter()
            {
                Name = "MAX", Duration = (long)(MaxDate - MinDate).TotalMilliseconds
            });

            base.OnInitialized();
        }
 void FilterIntervals(long filterDuration)
 {
     IntervalFilters = IntervalFilter.GetIntervalFilters().Where(i => i.Duration < filterDuration && filterDuration / i.Duration < 200).ToList();
 }
Пример #8
0
        public void Constructor_TypeIsCorrect()
        {
            var filter = new IntervalFilter(TestDimension, TestIntervalA);

            Assert.That(filter.Type, Is.EqualTo("interval"));
        }
Пример #9
0
        /// <summary>
        /// Maps the specified function to all the intervals in the two interval lists.
        /// </summary>
        /// <param name="xs">The first list of intervals.</param>
        /// <param name="ys">The second list of intervals.</param>
        /// <param name="filter">The filter function, which returns for an interval with the given
        /// start and end whether it should be present in the result. The boolean inputs to
        /// the function indicate in which of the source interval lists the interval is present.</param>
        /// <returns>The resulting list of intervals, all ordered, merged where possible.</returns>
        /// <remarks>
        /// The intervals are divided at every interval boundary,
        /// such that the resulting intervals do not partially overlap.
        /// </remarks>
        private static IReadOnlyList <int> Filter(IReadOnlyList <int> xs, IReadOnlyList <int> ys, IntervalFilter filter)
        {
            #region Contract
            Debug.Assert(xs != null);
            Debug.Assert(ys != null);
            Debug.Assert(filter != null);
            #endregion

            return(Fold(xs, ys, new List <int>(), (s, e, x, y, v) =>
            {
                bool keep = filter(s, e, x, y);
                if (keep != (v.Count % 2 != 0))
                {
                    // Add the interval start or end only if we're opening a new interval
                    // or closing an existing interval.
                    v.Add(s);
                }
                return v;
            }, (s, v) =>
            {
                if (v.Count % 2 != 0)
                {
                    // Close the final interval, if any.
                    v.Add(s);
                }
                Debug.Assert(v.Count % 2 == 0);
                return v;
            }));
        }