Skip to main content

Module metrics

Module metrics 

Source
Expand description

The plugin↔orchestrator metric contract: the raw tier-1 counts a language plugin measures for one unit (MetricInputs) and a sub-file unit carrying them (FunctionUnit).

These are pure data. A plugin’s metric engine produces them; the orchestrator (code-ranker-graph) consumes them — running the tier-2 CEL registry from metrics/builtin.toml and writing every metric onto the node. They live here in the foundation crate so a plugin depends only on this API, never on the heavier graph/enrichment crate, to hand back its measurements.

Structs§

FunctionUnit
One sub-file unit (a function / method / closure) with its tier-1 counts. Produced by a language engine’s compute_functions for the optional functions level. kind is a free-form, per-language string (fn / method / closure / lambda / …).
MetricInputs
Raw tier-1 counts a per-language engine measures for one unit (a file or, for the functions level, a function). Every tier-2 metric is a pure function of these, evaluated by the orchestrator’s built-in registry — see code-ranker-graph’s metrics/builtin.toml.