Beispiel #1
0
        /// <summary>
        /// Configures the Metric class with a configuration. Call this once at application startup (Main(), Global.asax, etc).
        /// </summary>
        /// <param name="config">Configuration settings.</param>
        public static void Configure(MetricsConfig config)
        {
            CheckValidity(config);

            _text = TextTypeFactory.Create(config);

            _statsD     = new SyncSender(_text, config.Tags);
            _configured = true;
        }
Beispiel #2
0
        public static AsyncSender ConfigureAsync(MetricsConfig config)
        {
            CheckValidity(config);

            _text = TextTypeFactory.Create(config);

            var asyncSender = new AsyncSender(
                _text,
                config.Tags,
                config.AsyncMaxNumberOfPointsInQueue,
                config.MaxUDPPacketSize);

            _statsD     = asyncSender;
            _configured = true;

            return(asyncSender);
        }