Class MeterInspector
- Namespace
- MetricsAssertions
- Assembly
- MetricsAssertions.dll
Discovery helper for the one thing Microsoft.Extensions.Diagnostics.Metrics.Testing.MetricCollector<T> cannot answer: which instruments a meter actually publishes (a registry question, not a measurement one). Uses a short-lived MeterListener - the only mechanism that enumerates a meter's instruments without knowing their names or value types up front.
public static class MeterInspector
- Inheritance
-
MeterInspector
- Inherited Members
Methods
IsPublished(string, string)
Returns whether the named instrument is published by the named meter.
public static bool IsPublished(string meterName, string instrumentName)
Parameters
Returns
PublishedInstrumentNames(string)
Returns the names of every instrument currently published by the named meter.
public static IReadOnlySet<string> PublishedInstrumentNames(string meterName)
Parameters
meterNamestringThe meter name to inspect.
Returns
PublishesAll(string, params string[])
Returns whether the named meter publishes every one of instrumentNames.
public static bool PublishesAll(string meterName, params string[] instrumentNames)
Parameters
meterNamestringThe meter name.
instrumentNamesstring[]The instrument names that must all be published.