# Class RoutingMetricsCollector

Collects routing decisions and outcomes to compute effectiveness metrics.

- Defined in packages/nexus-agents/src/observability/routing-metrics.ts:60

##### Index

### Constructors

constructor

### Methods

recordDecision
recordOutcome
getMetrics
renderDashboard
toJSON
reset

## Constructors

### constructor

- new RoutingMetricsCollector(
  config?: Partial<RoutingMetricsConfig>,
  ): RoutingMetricsCollector

  #### Parameters

  - `Optional` config: Partial<RoutingMetricsConfig>

  #### Returns RoutingMetricsCollector

  - Defined in packages/nexus-agents/src/observability/routing-metrics.ts:65

## Methods

### recordDecision

- recordDecision(record: RoutingRecord): void

  Record a routing decision.

  #### Parameters

  - record: RoutingRecord

  #### Returns void

  - Defined in packages/nexus-agents/src/observability/routing-metrics.ts:76

### recordOutcome

- recordOutcome(record: OutcomeRecord): void

  Record an outcome for a routing decision.

  #### Parameters

  - record: OutcomeRecord

  #### Returns void

  - Defined in packages/nexus-agents/src/observability/routing-metrics.ts:90

### getMetrics

- getMetrics(periodHours?: number): RoutingMetrics

  Get routing metrics for a time period.

  #### Parameters

  - periodHours: number = 24

  #### Returns RoutingMetrics

  - Defined in packages/nexus-agents/src/observability/routing-metrics.ts:104

### renderDashboard

- renderDashboard(config?: Partial<RoutingDashboardConfig>): string

  Generate ASCII dashboard output.

  #### Parameters

  - `Optional` config: Partial<RoutingDashboardConfig>

  #### Returns string

  - Defined in packages/nexus-agents/src/observability/routing-metrics.ts:152

### toJSON

- toJSON(periodHours?: number): string

  Get metrics as JSON for machine-readable output.

  #### Parameters

  - periodHours: number = 24

  #### Returns string

  - Defined in packages/nexus-agents/src/observability/routing-metrics.ts:175

### reset

- reset(): void

  Clear all collected data.

  #### Returns void

  - Defined in packages/nexus-agents/src/observability/routing-metrics.ts:182