Пример #1
0
 internal Preaggregation(
     string name,
     IEnumerable <string> dimensions,
     MinMaxConfiguration minMaxConfiguration,
     PercentileConfiguration percentileConfiguration,
     RollupConfiguration rollupConfiguration,
     PublicationConfiguration publicationConfiguration,
     DistinctCountConfiguration distinctCountConfiguration,
     IFilteringConfiguration filteringConfiguration)
 {
     this.Name                       = name;
     this.dimensions                 = dimensions.ToList();
     this.minMaxConfiguration        = minMaxConfiguration;
     this.percentileConfiguration    = percentileConfiguration;
     this.rollupConfiguration        = rollupConfiguration;
     this.publicationConfiguration   = publicationConfiguration;
     this.distinctCountConfiguration = distinctCountConfiguration;
     this.filteringConfiguration     = filteringConfiguration;
 }
Пример #2
0
 public static Preaggregation CreatePreaggregation(
     string name,
     IEnumerable <string> dimensions,
     MinMaxConfiguration minMaxConfiguration,
     PercentileConfiguration percentileConfiguration,
     RollupConfiguration rollupConfiguration,
     PublicationConfiguration metricStoreConfiguration,
     DistinctCountConfiguration distinctCountConfiguration)
 {
     return(CreatePreaggregationImpl(
                name,
                dimensions,
                minMaxConfiguration,
                percentileConfiguration,
                rollupConfiguration,
                metricStoreConfiguration,
                distinctCountConfiguration,
                Configuration.FilteringConfiguration.FilteringDisabled));
 }
Пример #3
0
 /// <summary>
 /// Creates a new filtered metrics store preaggregate with defaults for the configuration flags.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="dimensions">The dimensions.</param>
 /// <param name="minMaxConfiguration">The minimum maximum configuration. Default value is Configuration.MinMaxConfiguration.MinMaxDisabled.</param>
 /// <param name="percentileConfiguration">The percentile configuration. Default value is Configuration.PercentileConfiguration.PercentileDisabled.</param>
 /// <param name="rollupConfiguration">The rollup configuration. Default value is Configuration.RollupConfiguration.RollupDisabled.</param>
 /// <param name="metricStoreConfiguration">The metric store configuration. Default value is Configuration.PublicationConfiguration.AggregatedMetricsStore.</param>
 /// <param name="distinctCountConfiguration">The distinct count configuration. Default value is new DistinctCountConfiguration().</param>
 /// <param name="filteringConfiguration">The filtering configuration. Default value is Configuration.FilteringConfiguration.FilteringDisabled.</param>
 /// <returns>The created preaggregate.</returns>
 public static Preaggregation CreatePreaggregationWithDefaults(
     string name,
     IEnumerable <string> dimensions,
     MinMaxConfiguration minMaxConfiguration               = null,
     PercentileConfiguration percentileConfiguration       = null,
     RollupConfiguration rollupConfiguration               = null,
     PublicationConfiguration metricStoreConfiguration     = null,
     DistinctCountConfiguration distinctCountConfiguration = null,
     IFilteringConfiguration filteringConfiguration        = null)
 {
     return(CreatePreaggregationImpl(
                name,
                dimensions,
                minMaxConfiguration ?? Configuration.MinMaxConfiguration.MinMaxDisabled,
                percentileConfiguration ?? Configuration.PercentileConfiguration.PercentileDisabled,
                rollupConfiguration ?? Configuration.RollupConfiguration.RollupDisabled,
                metricStoreConfiguration ?? (distinctCountConfiguration?.Dimensions.Any() == true ? Configuration.PublicationConfiguration.CacheServer : Configuration.PublicationConfiguration.MetricStore),
                distinctCountConfiguration ?? new DistinctCountConfiguration(),
                filteringConfiguration ?? Configuration.FilteringConfiguration.FilteringDisabled));
 }
Пример #4
0
        /// <summary>
        /// Creates a new preaggregate.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="dimensions">The dimensions.</param>
        /// <param name="minMaxConfiguration">The minimum maximum configuration.</param>
        /// <param name="percentileConfiguration">The percentile configuration.</param>
        /// <param name="rollupConfiguration">The rollup configuration.</param>
        /// <param name="metricStoreConfiguration">The metric store configuration.</param>
        /// <param name="distinctCountConfiguration">The distinct count configuration.</param>
        /// <param name="filteringConfiguration">The filtering configuration.</param>
        /// <returns>The created preaggregate.</returns>
        private static Preaggregation CreatePreaggregationImpl(
            string name,
            IEnumerable <string> dimensions,
            MinMaxConfiguration minMaxConfiguration,
            PercentileConfiguration percentileConfiguration,
            RollupConfiguration rollupConfiguration,
            PublicationConfiguration metricStoreConfiguration,
            DistinctCountConfiguration distinctCountConfiguration,
            IFilteringConfiguration filteringConfiguration)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentNullException(nameof(name));
            }

            if (dimensions == null)
            {
                throw new ArgumentNullException(nameof(dimensions));
            }

            var dimensionList = dimensions.ToList();

            dimensionList.Sort(StringComparer.OrdinalIgnoreCase);
            for (var i = 0; i < (dimensionList.Count - 1); i++)
            {
                if (string.Equals(dimensionList[i], dimensionList[i + 1], StringComparison.OrdinalIgnoreCase))
                {
                    throw new ArgumentException("Cannot create a preaggregate with duplicate dimensions.");
                }
            }

            if (minMaxConfiguration == null)
            {
                throw new ArgumentNullException(nameof(minMaxConfiguration));
            }

            if (percentileConfiguration == null)
            {
                throw new ArgumentNullException(nameof(percentileConfiguration));
            }

            if (rollupConfiguration == null)
            {
                throw new ArgumentNullException(nameof(rollupConfiguration));
            }

            if (metricStoreConfiguration == null)
            {
                throw new ArgumentNullException(nameof(metricStoreConfiguration));
            }

            if (distinctCountConfiguration == null)
            {
                throw new ArgumentNullException(nameof(distinctCountConfiguration));
            }

            if (filteringConfiguration == null)
            {
                throw new ArgumentNullException(nameof(filteringConfiguration));
            }

            return(new Preaggregation(
                       name,
                       dimensionList,
                       minMaxConfiguration,
                       percentileConfiguration,
                       rollupConfiguration,
                       metricStoreConfiguration,
                       distinctCountConfiguration,
                       filteringConfiguration));
        }