Get Simulation Report
Generates a comprehensive statistical report of the completed or current simulation, including wait times, throughput, utilization, and queue statistics.
Response
Status of the response: success or error
Unique identifier of the simulation.
Total elapsed simulation time in seconds.
Total number of customers who arrived at the bank.
Total number of customers who completed service.
Number of customers rejected due to queue capacity limits.
Mean wait time across all customers (in seconds).
Average wait times broken down by priority level. Average wait time for HIGH priority customers.
Average wait time for MEDIUM priority customers.
Average wait time for LOW priority customers.
Mean service time across all served customers (in seconds).
Mean total time in system (wait + service) in seconds.
Peak queue length observed during simulation.
Time-weighted average queue length.
Utilization rate for each teller (percentage of time busy).
Average utilization across all tellers (0.0 to 1.0).
Customers served per time unit (customers/second).
Number of times the system was idle with no customers.
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 of the response: success or error
Current simulation clock time in seconds.
Number of customers currently waiting.
Number of tellers currently serving customers.
Number of tellers currently available.
Total customers served up to this point.
Total customers currently in the system (waiting + being served).
Customers served in the last time window (customers/minute).
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.