Skip to main content
The vehicle statistics page (/vehicle-stats/[alias]) gives you a complete financial and operational picture of a single vehicle. It aggregates data from routes, refuels, maintenance records, and expenses into one dashboard.

Metrics overview

Activity counts

Total number of routes, refuels, maintenance records, and expense entries logged for the vehicle.

Cost breakdown

Fuel costs, maintenance costs, other expenses, total cost, and cost per kilometer.

Efficiency metrics

Kilometers per liter, kilometers per gallon, and average distance per route.

Total cost of ownership

The cumulative amount spent on the vehicle since its first recorded entry.

Activity counts

The statistics page shows four activity counters pulled from VehicleStats.statistics:
MetricFieldDescription
Total routestotalRoutesNumber of trip records logged
Total refuelstotalRefuelsNumber of fuel refill records
Total maintenancetotalMaintenancesNumber of maintenance service records
Total expensestotalExpensesNumber of expense entries
Total distancetotalDistanciaSum of all route distances in kilometers

Cost breakdown

Costs are categorized into three buckets, each with a distinct color to help you scan the dashboard quickly.
CategoryFieldColor
Fuel costscombustibleBlue (info)
Maintenance costsmantenimientoAmber (warning)
Other expensesgastosOtrosPurple
Total costtotalAmber (warning)
The cost per kilometer (costoPorKm) divides the total cost by the total distance traveled, giving you a single number that represents the true running cost of the vehicle.
Check cost per km regularly. It is the most useful single metric for understanding how much your vehicle actually costs to operate — it accounts for fuel, maintenance, and all other expenses together.

Efficiency metrics

Fuel efficiency metrics are calculated from refuel records and route data:
MetricFieldDescription
km per literkmPorLitroDistance traveled per liter of fuel consumed
km per gallonkmPorGalonDistance traveled per gallon of fuel consumed
Average distance per routepromedioDistanciaPorRutaMean trip length across all logged routes
These values come from the VehicleStats.efficiency object returned by GET /api/vehicles/[alias]/stats.

Total cost of ownership

The total cost of ownership (totalCostOfOwnership on EnhancedVehicleStats) sums every recorded cost — fuel, maintenance, and other expenses — from the vehicle’s first entry to the present. Use this figure to compare vehicles in your fleet or evaluate whether it is more economical to replace a vehicle. The total distance traveled (totalDistance) is the cumulative kilometers logged across all routes.

StatCard color coding

The statistics dashboard uses color-coded stat cards to help you identify cost categories at a glance:
ColorAccentUsed for
BlueinfoFuel costs (combustible)
AmberwarningMaintenance costs, total cost
PurplepurpleOther expenses (gastosOtros)
GreensuccessActive status indicators
This color system matches the domain tokens defined in globals.css (--color-cat-fuel, --color-cat-maintenance, --color-cat-expenses) and is consistent across all pages in KilomeTracker.

TypeScript interfaces

The stats page is powered by two interfaces from src/Types.ts:
export interface VehicleStats {
  vehicle: Vehicle;
  statistics: {
    totalRoutes: number;
    totalRefuels: number;
    totalMaintenances: number;
    totalExpenses: number;
    totalDistancia: number;
  };
  costs: {
    combustible: number;
    mantenimiento: number;
    gastosOtros: number;
    total: number;
    costoPorKm: number;
  };
  efficiency: {
    kmPorLitro: number;
    kmPorGalon: number;
    promedioDistanciaPorRuta: number;
  };
}

export interface EnhancedVehicleStats {
  counts: {
    totalRoutes: number;
    totalRefuels: number;
    totalMaintenance: number;
    totalExpenses: number;
  };
  costs: {
    fuelCost: number;
    maintenanceCost: number;
    otherExpenses: number;
    totalCost: number;
  };
  efficiency: {
    kmPerLiter: number;
    kmPerGallon: number;
    averageDistancePerRoute: number;
    costPerKm: number;
  };
  totalCostOfOwnership: number;
  totalDistance: number;
}
Data is fetched from GET /api/vehicles/[alias]/stats.

Managing vehicles

Add, edit, and deactivate vehicles in your fleet.

Tracking fuel

Log refuels to keep efficiency metrics accurate.

Tracking maintenance

Record service events that contribute to maintenance costs.

Expenses

Track insurance, taxes, and other costs included in total cost of ownership.

Build docs developers (and LLMs) love