File size: 435 Bytes
abd4592
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from fastapi import APIRouter
from typing import Dict, Any

router = APIRouter()

# Mock storage for metrics
metrics_store = {
    "ingestion_total": 0,
    "retrieval_total": 0,
    "generation_total": 0,
    "average_latency": 0.0
}

@router.get("/")
def get_metrics():
    return metrics_store

def increment_metric(metric_name: str):
    if metric_name in metrics_store:
        metrics_store[metric_name] += 1