Class MeterExtensions
- Namespace
- Cratis.Metrics
- Assembly
- Cratis.Fundamentals.dll
Extension methods for working with meters.
public static class MeterExtensions
- Inheritance
-
MeterExtensions
- Inherited Members
Methods
BeginScope<T>(IMeter<T>, IDictionary<string, object>)
Begin a scope for a meter.
public static IMeterScope<T> BeginScope<T>(this IMeter<T> meter, IDictionary<string, object> tags)
Parameters
meterIMeter<T>The meter to begin scope for.
tagsIDictionary<string, object>The tags associated with the scope.
Returns
- IMeterScope<T>
A new IMeterScope<T>.
Type Parameters
TType the scope is for.
BeginScope<T>(IMeter<T>, object)
Begin a scope for a meter using an anonymous type for tags.
[UnconditionalSuppressMessage("Trimming", "IL2075", Justification = "The tags object's runtime type properties are accessed for metric tagging; callers are responsible for preserving the type.")]
public static IMeterScope<T> BeginScope<T>(this IMeter<T> meter, object tags)
Parameters
meterIMeter<T>The meter to begin scope for.
tagsobjectAn anonymous object containing the tags. Property names become tag keys and property values become tag values.
Returns
- IMeterScope<T>
A new IMeterScope<T>.
Type Parameters
TType the scope is for.
Exceptions
- ArgumentNullException
The exception that is thrown when tags is null.