Skip to main content

Get Simulation Report

Generates a comprehensive statistical report of the completed or current simulation, including wait times, throughput, utilization, and queue statistics.

Response

status
string
Status of the response: success or error
data
object

Example Request

curl http://localhost:5000/api/metrics/report

Example Response

{
  "status": "success",
  "data": {
    "simulation_id": "a3f2c1b5",
    "total_simulation_time": 14400.0,
    "customers_arrived": 2156,
    "customers_served": 2148,
    "customers_rejected": 8,
    "average_wait_time": 45.3,
    "wait_time_by_priority": {
      "1": 12.5,
      "2": 38.2,
      "3": 67.8
    },
    "average_service_time": 3.98,
    "average_total_time": 49.28,
    "max_queue_length": 23,
    "average_queue_length": 8.4,
    "teller_utilization": {
      "T-1": 0.89,
      "T-2": 0.87,
      "T-3": 0.91
    },
    "overall_utilization": 0.89,
    "throughput": 0.149,
    "starvation_incidents": 3
  }
}
The report can be requested at any time, even while the simulation is running. Final metrics are only accurate after the simulation has completed.

Get Live Metrics

Retrieves real-time metrics for a currently running simulation, useful for monitoring and visualization.

Response

status
string
Status of the response: success or error
data
object

Example Request

curl http://localhost:5000/api/metrics/live

Example Response

{
  "status": "success",
  "data": {
    "current_time": 3247.82,
    "current_queue_length": 7,
    "active_tellers": 2,
    "idle_tellers": 1,
    "customers_served_so_far": 485,
    "customers_in_system": 9,
    "recent_throughput": 8.94
  }
}
This endpoint only works when a simulation is actively running. It will return an error if called when no simulation is active.

Metrics Data Structures

For detailed information about the metrics data structures returned by these endpoints, see the Metrics Model documentation.

Build docs developers (and LLMs) love