Metalama//API Documentation/Aspect API/Metalama.​Framework.​Metrics
Open sandboxFocus

Namespace Metalama.Framework.Metrics

This namespace allows you to consume and implement metrics.

To consume a metric, start from a declaration, call the extension method MetricsExtensions.Metric, then call Get.

Class Diagram

classDiagram class IMeasurable { } class IDeclaration { } class IMetric~TMeasurable~ { } class YourCustomMetric { } class YourCustomMetricProvider { <<sdk>> } class IMetricProvider~TMetric~ { GetMetric(IMeasurable) } class Metrics~TMeasurable~ { Get() } class MetricsExtensions { <<extension class>> Metrics()$ } IMeasurable <-- MetricsExtensions : extension methods Metrics <-- MetricsExtensions : exposes IMetric~TMeasurable~ <-- Metrics : exposes IMeasurable <|-- IDeclaration : implements IMetric~TMeasurable~ <|-- YourCustomMetric : implements IMetricProvider~TMetric~ <|-- YourCustomMetricProvider : implements YourCustomMetric <-- YourCustomMetricProvider : computes IMetric~TMeasurable~ <-- IMetricProvider~TMetric~ : computes IMeasurable <-- IMetric~TMeasurable~ : applies to

Namespace members



Exposes a Get<TExtension>() method, which computes and returns a metric for an eligible object.


Exposes metrics to eligible objects.



Base interface for objects that can be extended with metrics.


A weakly-typed base interface for IMetric<T>. Never implement directly. Always implement IMetric<T>.


Base interface for all metrics. This interface exists only for strong typing. It does not have any members.


Implements the computation or reading of a metric.