protected string GenerateStatKey(Glmps.Message.ITimelineMessage message)
        {
            string key = String.Empty;

            if (message is Glmps.Message.ISourceMessage)
            {
                var source = message as Glmps.Message.ISourceMessage;
                key = source.ExecutedType.FullName + "." + source.ExecutedMethod.Name;
            }
            else
            {
                string subtext = string.IsNullOrWhiteSpace(message.EventSubText) ? "" : "_" + message.EventSubText;
                key = message.EventName + subtext;

                key = key.Replace(".", "-");
                key = key.Replace(" ", "_");
            }

            return(key);
        }
        public void SendMessageStats(Glmps.Message.ITimelineMessage message, ITabSetupContext context = null)
        {
            if (message is StatsdNetMessage)
            {
                return;
            }

            var timer     = InitializeTimer(message);
            var selfTimer = Stopwatch.StartNew();

            string statKey = GenerateStatKey(message);

            StatsdPipe.Timing(statKey, (long)message.Duration.TotalMilliseconds);

            IncrementStoredCount(statKey, context);

            selfTimer.Stop();

            timer.Duration = selfTimer.Elapsed;
            PublishTimingMessage(timer, message, context);

            IncrementStoredCount("StatsdNet.TimingSum", context, timer.Duration.TotalMilliseconds);
            StatsdPipe.Timing("GlimpseStatsdNetTiming", (long)timer.Duration.TotalMilliseconds);
        }