Skip to content

Conversation

@AlexanderKanakis
Copy link
Collaborator

private async getAnalyticsQueueTime(read: IRead, assoc: RocketChatAssociationRecord) {
const { queueTimeStart } = await retrievePersistentData(read, assoc);
if (queueTimeStart === null) {
throw new Error(ErrorLogs.QUEUE_TIME_NOT_SET);
Copy link

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@ear-dev ear-dev requested a review from Shailesh351 September 9, 2022 17:05
@ear-dev
Copy link

ear-dev commented Sep 9, 2022

@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) {
Copy link
Collaborator

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`;
Copy link
Collaborator

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

Copy link

@ear-dev ear-dev Sep 12, 2022

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?

Copy link
Collaborator Author

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.

Comment on lines 182 to 183
const dt = Math.ceil((Date.now() - queueTimeStart) / 1000);
return dt;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const dt = Math.ceil((Date.now() - queueTimeStart) / 1000);
return dt;
return Math.ceil((Date.now() - queueTimeStart) / 1000);

@ear-dev ear-dev merged commit 9e24198 into master Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants