-
Notifications
You must be signed in to change notification settings - Fork 1
[New] Send Queue Timer upon Escalation #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| private async getAnalyticsQueueTime(read: IRead, assoc: RocketChatAssociationRecord) { | ||
| const { queueTimeStart } = await retrievePersistentData(read, assoc); | ||
| if (queueTimeStart === null) { | ||
| throw new Error(ErrorLogs.QUEUE_TIME_NOT_SET); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if this error gets thrown? Will we still send the ESCALATION_SUCCESSFUL event? Basically, we do not want to kill the event if the timer fails, we just want to send an empty string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
|
@Shailesh351 can you take a look at this one when you have a chance please? thanks. |
|
|
||
| private async getAnalyticsQueueTime(read: IRead, assoc: RocketChatAssociationRecord) { | ||
| const { queueTimeStart } = await retrievePersistentData(read, assoc); | ||
| if (queueTimeStart === null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using === here only checks for null and in the case of undefined, it will send the incorrect data. How about using !queueTimeStart ?
| return ''; | ||
| } | ||
| const dt = Math.ceil((Date.now() - queueTimeStart) / 1000); | ||
| return `${dt} seconds`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexanderKanakis @ear-dev PR is working as expected. Just one doubt. Currently, it logs data as string <t> seconds i.e 10 seconds , 999 seconds etc.
Are we good with this or we should just pass numeric value? Just thinking from the metrics perspective
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Shailesh351 great question.... I just asked Molly and she would like an integer and not a string. So lets just pass the number only. I assume we can pass integers in the topic message body?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Shailesh351 @ear-dev Fixed with new commits.
| const dt = Math.ceil((Date.now() - queueTimeStart) / 1000); | ||
| return dt; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const dt = Math.ceil((Date.now() - queueTimeStart) / 1000); | |
| return dt; | |
| return Math.ceil((Date.now() - queueTimeStart) / 1000); |
Solves: WideChat/Rocket.Chat#1286