Chat average wait time calculation

Davina
Giga Contributor

Hi,

 

This is my first time implementing the chat functionality in SN.

 

I have a question around the Business Rule SNC - Chat Queue Average Wait Time

 

Has anyone built the average wait time business rule to set this based on the calls in the past hour rather than the last 20 calls.

 

So check how many calls in the last hour, check the wait time for each, then calculate the average?

 

As always, Any help is much appreciated!

6 REPLIES 6

I think you're right. 

 

It only calculates the average per queue and the widget only shows ONE queue.

 

We  have four queues and this widget only shows one, unfortunately for us the queue we have as default is the one with the longest wait time.

Nayan Mahato
Tera Guru

Hi,

The calculation itself is started by the OOB business rule "Calculate Avg Wait Time for Queue" from the "interaction" table.
Within this business rule it's using the function "refreshAvgWaitTime()" which is actually a function from a back-end Java file.


This Java function computes the average wait time as following:
1) Get the latest 20 "interaction" (the table that keeps track of the walk-up requests) records where state = Work in Progress for a particular queue location
2) Get their "wait_time" values
3) Add all of these up and divide it by 20 (or whatever valid records available at the time based on the query; i.e. if you only have 5 interaction records where state = Work in progress then it'll divide it by 5 only)
4) The resulting value would be the average which will then be updated to the "Average wait time" field on the location queue record (wu_location_queue)

Regards,

Nayan