コード例 #1
0
        public CounterMetric GetMetric(DateTime start, DateTime end, CounterMetricCategory category)
        {
            string key = CalculateHashKey(start, end, category);
            if (!_metrics.ContainsKey(key))
            {
                _metrics[key] = new CounterMetric(start, end, category);
            }

            return _metrics[key];
        }
コード例 #2
0
 public bool TryGetMetric(DateTime start, DateTime end, CounterMetricCategory category, out CounterMetric metric)
 {
     string key = CalculateHashKey(start, end, category);
     return _metrics.TryGetValue(key, out metric);
 }