public void Check_Collect(string prefixName) { using var stream = new MemoryStream(); var metricWriter = new MetricsTextWriter(stream); var collector = new GCCollectionCountCollector(prefixName); collector.Collect(metricWriter); metricWriter.FlushAsync(); var response = Encoding.UTF8.GetString(stream.ToArray()); Assert.Contains($"# TYPE {prefixName}dotnet_collection_count_total counter", response); }
public void Check_MetricNames(string prefixName) { var collector = new GCCollectionCountCollector(prefixName); Assert.Equal(prefixName + "dotnet_collection_count_total", collector.MetricNames.First()); }