Example #1
0
        public void Dispose()
        {
            if (!_disposed)
            {
                _disposed = true;
                _stopWatch.Stop();

                if (_dogStatsd == null)
                {
                    DogStatsd.Timer(_name, _stopWatch.ElapsedMilliseconds(), _sampleRate, Tags.ToArray());
                }
                else
                {
                    _dogStatsd.Timer(_name, _stopWatch.ElapsedMilliseconds(), _sampleRate, Tags.ToArray());
                }
            }
        }
 public static void Timer <T>(string statName, T value, double sampleRate = 1.0, string[] tags = null) =>
 _dogStatsdService.Timer <T>(statName: statName, value: value, sampleRate: sampleRate, tags: tags);