CustomMetricEngine

Discovers MetricProviders from the classpath and runs them against a graph, fail-silent.

Discovery uses the JDK ServiceLoader, so any jar on the plugin's runtime classpath that ships a META-INF/services/com.aalekh.aalekh.analysis.spi.MetricProvider file contributes automatically. Every failure mode - a provider whose class won't instantiate, a blank or duplicate metric id, a provider that throws while computing - is captured as a note in CustomMetricReport.providerFailures rather than propagated, mirroring the fail-silent contract of the rest of Aalekh's extraction and analysis.

Functions

Link copied to clipboard

Runs providers against graph, assembling each provider's raw contribution into a CustomMetric. Providers are processed in order; a blank id, an id already emitted, or a provider that throws is recorded in CustomMetricReport.providerFailures and skipped.

Link copied to clipboard
fun load(classLoader: ClassLoader): List<MetricProvider>

Loads all MetricProviders visible to classLoader. A provider that cannot be instantiated (missing class, throwing constructor, malformed service entry) is skipped; discovery continues with the rest. Never throws.

Link copied to clipboard

Discovers providers via load and runs them with compute in one step - the entry point the aalekhMetrics task uses.