/// <summary>
        /// Initializes a new instance of the <see cref="SamplingMonitoringChannel" /> class.
        /// </summary>
        /// <param name="keyBuilder">Builds up the final metric key.</param>
        /// <param name="formatter">The message formatter.</param>
        /// <param name="pipe">The pipe.</param>
        /// <param name="sampling">The sampling.</param>
        public SamplingMonitoringChannel(Func<string, string> keyBuilder, ISampledMessageFormatter formatter, ISamplingPipe pipe, float sampling)
        {
            if (pipe == null)
                throw new ArgumentNullException("pipe");

            if (formatter == null)
                throw new ArgumentNullException("formatter");

            this.pipe = pipe;
            this.formatter = formatter;

            this.sampling = sampling;
            this.keyBuilder = keyBuilder ?? (Func<string, string>)((string k) => k);
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SamplingMonitoringChannel" /> class.
        /// </summary>
        /// <param name="keyBuilder">Builds up the final metric key.</param>
        /// <param name="formatter">The message formatter.</param>
        /// <param name="pipe">The pipe.</param>
        /// <param name="sampling">The sampling.</param>
        public SamplingMonitoringChannel(Func <string, string> keyBuilder, ISampledMessageFormatter formatter, ISamplingPipe pipe, float sampling)
        {
            if (pipe == null)
            {
                throw new ArgumentNullException("pipe");
            }

            if (formatter == null)
            {
                throw new ArgumentNullException("formatter");
            }

            this.pipe      = pipe;
            this.formatter = formatter;

            this.sampling   = sampling;
            this.keyBuilder = keyBuilder ?? (Func <string, string>)((string k) => k);
        }