public void MetricNameIsUsedForTimer() { var tags = new Dictionary <string, string> { { "foo", "bar" } }; InMemoryMetricsFactory inMemoryMetricsFactory = new InMemoryMetricsFactory(); inMemoryMetricsFactory.CreateTimer("thetimer", tags); Assert.Equal(-1, inMemoryMetricsFactory.GetTimer("thetimer", new Dictionary <string, string>())); Assert.Equal(0, inMemoryMetricsFactory.GetTimer("thetimer", tags)); }
public void TimerValueIsIncreased() { var tags = new Dictionary <string, string> { { "foo", "bar" } }; InMemoryMetricsFactory inMemoryMetricsFactory = new InMemoryMetricsFactory(); ITimer timer = inMemoryMetricsFactory.CreateTimer("thetimer", tags); Assert.Equal(0, inMemoryMetricsFactory.GetTimer("thetimer", tags)); timer.DurationTicks(1); Assert.Equal(1, inMemoryMetricsFactory.GetTimer("thetimer", tags)); }