MeterFactoryExtensions
Extension methods for Meter and IMeterFactory.
using System.Collections.Generic;
using System.Runtime.CompilerServices;
namespace System.Diagnostics.Metrics
{
public static class MeterFactoryExtensions
{
[System.Runtime.CompilerServices.NullableContext(1)]
public static Meter Create(this IMeterFactory meterFactory, string name, [System.Runtime.CompilerServices.Nullable(2)] string version = null, [System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0,
1,
2
})] IEnumerable<KeyValuePair<string, object>> tags = null)
{
if (meterFactory == null)
throw new ArgumentNullException("meterFactory");
return meterFactory.Create(new MeterOptions(name) {
Version = version,
Tags = tags,
Scope = meterFactory
});
}
}
}