Example #1
0
File: M.cs Project: modulexcite/ab
        public static void Track(string metric, long increment = 1)
        {
            IMetric tracker;

            if (increment <= 0 || (tracker = MetricRepository.GetByName(metric)) == null)
            {
                return;
            }
            tracker.OnHook(new MetricEventArgs(metric, DateTime.Today.ToUnixTime(), increment));
        }
Example #2
0
        private static IMetric GetOrRegisterMetric(string entry)
        {
            var metric = MetricRepository.GetByName(entry);

            if (metric == null)
            {
                metric = new InMemoryMetric(entry);
                MetricRepository.Save(metric);
            }
            return(metric);
        }