public void TimeIntervalCollectionAcceptance() { var collection = new TimeIntervalCollection(); Assert.Equal(0, collection.Count); collection.AddIntervals("i1"); collection.AddIntervals("i2"); Assert.Equal(2, collection.GetIntervalsCount()); var ti = new TimeInterval(); ti.Start(); ti.Stop(); collection.AddInterval("i1", ti); collection.AddInterval("i2", ti); collection.AddInterval("i3", ti); collection.AddInterval("i3", ti); var i3 = collection.GetIntervals("i3").ToList(); Assert.Equal(2, i3.Count); collection.Reset("i3"); i3 = collection.GetIntervals("i3").ToList(); Assert.Equal(0, i3.Count); }
public MetricsService(string name) { this.counterCollection = new CounterCollection(); this.meterCollection = new MeterCollection(); this.snapshotCollectiion = new SnapshotCollectiion(); this.timeIntervalCollection = new TimeIntervalCollection(); this.gaugeCollection = new GaugeCollection(); this.name = name; }