1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright (c) 2026 vectorless developers
// SPDX-License-Identifier: Apache-2.0
//! Unified metrics collection for Vectorless.
//!
//! This module provides centralized metrics collection across all components:
//! - **LLM Metrics** — Token usage, latency, cost
//! - **Pilot Metrics** — Decisions, accuracy, feedback
//! - **Retrieval Metrics** — Paths, scores, iterations, cache
//!
//! # Architecture
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────────────┐
//! │ MetricsHub │
//! │ │
//! │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
//! │ │ LlmMetrics │ │PilotMetrics │ │RetrievalMetrics│ │
//! │ │ │ │ │ │ │ │
//! │ │ - tokens │ │ - decisions │ │ - paths │ │
//! │ │ - latency │ │ - accuracy │ │ - scores │ │
//! │ │ - cost │ │ - feedback │ │ - cache │ │
//! │ └─────────────┘ └─────────────┘ └─────────────┘ │
//! │ │
//! │ ┌─────────────────────────────────────────────────────────┐ │
//! │ │ MetricsReport │ │
//! │ │ │ │
//! │ │ Aggregated report with all metrics and statistics │ │
//! │ └─────────────────────────────────────────────────────────┘ │
//! └─────────────────────────────────────────────────────────────────┘
//! ```
//!
//! # Example
//!
//! ```rust
//! use vectorless::metrics::{MetricsHub, MetricsConfig, InterventionPoint};
//!
//! let config = MetricsConfig::default();
//! let hub = MetricsHub::new(config);
//!
//! // Record LLM call
//! hub.record_llm_call(100, 50, 150, true);
//!
//! // Record Pilot decision
//! hub.record_pilot_decision(0.85, InterventionPoint::Fork);
//!
//! // Generate report
//! let report = hub.generate_report();
//! println!("Total cost: ${:.4}", report.llm.estimated_cost_usd);
//! ```
pub use ;
pub use IndexMetrics;
pub use LlmMetricsReport;
pub use PilotMetricsReport;
pub use RetrievalMetricsReport;