Get Tellers State
Retrieves the current state of all teller windows in the simulation, including their status, current customer (if any), and service statistics.
Response
Status of the response: success or error
Array of Teller objects. Teller identifier (e.g., “T-1”, “T-2”).
Current operational status: IDLE, BUSY, or BROKEN.
The Customer currently being served, or null if idle. Total number of customers served by this teller.
Total number of teller windows.
Number of tellers currently idle.
Number of tellers currently serving customers.
Number of tellers out of service.
Example Request
curl http://localhost:5000/api/tellers/state
Example Response
{
"status" : "success" ,
"data" : {
"tellers" : [
{
"id" : "T-1" ,
"status" : "BUSY" ,
"current_customer" : {
"id" : "c7f3a1b2" ,
"arrival_time" : 3240.15 ,
"service_time" : 4.2 ,
"priority" : 2 ,
"transaction_type" : "DEPOSIT" ,
"status" : "BEING_SERVED" ,
"service_start_time" : 3245.30
},
"sessions_served" : 45
},
{
"id" : "T-2" ,
"status" : "IDLE" ,
"current_customer" : null ,
"sessions_served" : 42
},
{
"id" : "T-3" ,
"status" : "BUSY" ,
"current_customer" : {
"id" : "d8e4b3c1" ,
"arrival_time" : 3238.92 ,
"service_time" : 5.1 ,
"priority" : 1 ,
"transaction_type" : "WITHDRAWAL" ,
"status" : "BEING_SERVED" ,
"service_start_time" : 3243.10
},
"sessions_served" : 48
}
],
"summary" : {
"total_tellers" : 3 ,
"idle_count" : 1 ,
"busy_count" : 2 ,
"broken_count" : 0
}
}
}
Teller state is only available when a simulation is initialized or running. The endpoint will return an error if no simulation exists.
Use Cases
Monitor Teller Utilization
Use this endpoint to track real-time teller utilization and identify bottlenecks:
# Poll teller state every 5 seconds
while true ; do
curl http://localhost:5000/api/tellers/state | jq '.data.summary'
sleep 5
done
Identify Idle Resources
Filter for idle tellers to optimize resource allocation:
curl http://localhost:5000/api/tellers/state | \
jq '.data.tellers[] | select(.status == "IDLE")'
Monitor how many customers each teller has served:
curl http://localhost:5000/api/tellers/state | \
jq '.data.tellers[] | {id, sessions_served}'
Teller Status Values
IDLE - Teller is available and waiting for the next customer
BUSY - Teller is currently serving a customer
BROKEN - Teller is out of service (simulated failure scenario)
The BROKEN status is used for simulating service disruptions. In the current implementation, tellers do not automatically break but this status is available for future enhancements.