/// <summary>
        /// Gauges is a simple metric type that takes the value from the delegate. 
        /// It can be used to track the value of performance counter or queue size. 
        /// </summary>
        /// <param name="telemetryClient">Telemetry client to get Gauge from.</param>
        /// <param name="name">Name of the gauge.</param>
        /// <param name="valueFunc">Callback function to return the gauge value.</param>
        public static void Gauge(this TelemetryClient telemetryClient, string name, Func<int> valueFunc)
        {
            var gauge = new GaugeImplementation(name, telemetryClient.Context, valueFunc);

            var configuration = GetConfigurationFromClient(telemetryClient);

            configuration.RegisterCounter(gauge);
        }
        public void CounteResetDoNotSetValueToZero()
        {
            var value = 10;

            var counter = new GaugeImplementation("test", new TelemetryContext(), () => { return(value); });

            Assert.AreEqual(10, counter.GetValueAndReset().Value);
            Assert.AreEqual(10, counter.GetValueAndReset().Value);
        }
        public void CounteResetDoNotSetValueToZero()
        {
            var value = 10;

            var counter = new GaugeImplementation("test", new TelemetryContext(), () => { return value; });

            Assert.AreEqual(10, counter.GetValueAndReset().Value);
            Assert.AreEqual(10, counter.GetValueAndReset().Value);
        }
        public void GaugeUsesValueFromDelegate()
        {
            var value = 10;

            var counter = new GaugeImplementation("test", new TelemetryContext(), () => { return value; });

            Assert.AreEqual(10, counter.GetValueAndReset().Value);

            value = 20;

            Assert.AreEqual(20, counter.GetValueAndReset().Value);
        }
        public void GaugeUsesValueFromDelegate()
        {
            var value = 10;

            var counter = new GaugeImplementation("test", new TelemetryContext(), () => { return(value); });

            Assert.AreEqual(10, counter.GetValueAndReset().Value);

            value = 20;

            Assert.AreEqual(20, counter.GetValueAndReset().Value);
        }