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]; }
public bool TryGetMetric(DateTime start, DateTime end, CounterMetricCategory category, out CounterMetric metric) { string key = CalculateHashKey(start, end, category); return _metrics.TryGetValue(key, out metric); }