示例#1
0
        /// <summary />
        /// <param name="seriesCountLimit"></param>
        /// <param name="valuesPerDimensionLimit"></param>
        /// <param name="seriesConfig"></param>
        public MetricConfiguration(
            int seriesCountLimit,
            int valuesPerDimensionLimit,
            IMetricSeriesConfiguration seriesConfig)
        {
            if (seriesCountLimit < 1)
            {
                throw new ArgumentOutOfRangeException(
                          nameof(seriesCountLimit),
                          $"Metrics must allow at least one data series (but {seriesCountLimit} was specified).");
            }

            if (valuesPerDimensionLimit < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(valuesPerDimensionLimit));
            }

            Util.ValidateNotNull(seriesConfig, nameof(seriesConfig));

            SeriesCountLimit        = seriesCountLimit;
            ValuesPerDimensionLimit = valuesPerDimensionLimit;

            SeriesConfig = seriesConfig;

            _hashCode = Util.CombineHashCodes(
                SeriesCountLimit.GetHashCode(),
                ValuesPerDimensionLimit.GetHashCode(),
                SeriesConfig.GetType().FullName.GetHashCode(),
                SeriesConfig.GetHashCode());
        }
        /// <summary>
        /// </summary>
        /// <param name="usePersistentAggregation"></param>
        /// <param name="caseSensitiveDistinctions"></param>
        public MetricSeriesConfigurationForNaiveDistinctCount(bool usePersistentAggregation, bool caseSensitiveDistinctions)
        {
            _usePersistentAggregation = usePersistentAggregation;
            _caseSensitive            = caseSensitiveDistinctions;

            _hashCode = Util.CombineHashCodes(_usePersistentAggregation.GetHashCode(), _caseSensitive.GetHashCode());
        }
示例#3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="alwaysResendLastValue"></param>
        /// <param name="restrictToUInt32Values"></param>
        public MetricSeriesConfigurationForGauge(bool alwaysResendLastValue, bool restrictToUInt32Values)
        {
            _alwaysResendLastValue  = alwaysResendLastValue;
            _restrictToUInt32Values = restrictToUInt32Values;

            _hashCode = Util.CombineHashCodes(_alwaysResendLastValue.GetHashCode(), _restrictToUInt32Values.GetHashCode());
        }
示例#4
0
 private int ComputeHashCode()
 {
     return(Util.CombineHashCodes(
                this.SeriesCountLimit.GetHashCode(),
                Util.CombineHashCodes(this.valuesPerDimensionLimits),
                this.SeriesConfig.GetType().FullName.GetHashCode(),
                this.SeriesConfig.GetHashCode()));
 }
        /// <summary>CReates a new configuration.</summary>
        /// <param name="restrictToUInt32Values">Whether only integer numbers should be tracked (used for some integer-optimized backends).</param>
        public MetricSeriesConfigurationForMeasurement(bool restrictToUInt32Values)
        {
            this.restrictToUInt32Values = restrictToUInt32Values;

            this.hashCode = Util.CombineHashCodes(this.restrictToUInt32Values.GetHashCode());
        }
        /// <summary />
        /// <param name="restrictToUInt32Values"></param>
        public MetricSeriesConfigurationForAccumulator(bool restrictToUInt32Values)
        {
            _restrictToUInt32Values = restrictToUInt32Values;

            _hashCode = Util.CombineHashCodes(_restrictToUInt32Values.GetHashCode());
        }