-
Notifications
You must be signed in to change notification settings - Fork 407
#RI-3751-add command execution time #1347
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
…1_command_execution_time
…disearch Feature/ri 2831 browser redisearch
…ub.com/RedisInsight/RedisInsight into feature/RI-3751_command_execution_time
…ub.com/RedisInsight/RedisInsight into feature/RI-3751_command_execution_time
if (executionTimeInNanoseconds !== 0) { | ||
commandExecution.executionTime = Math.round(executionTimeInNanoseconds / 1000); | ||
} | ||
|
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.
I'm not sure that using hrtime()
is a correct way here.
At first it is legacy function - https://nodejs.org/api/process.html#processhrtimetime. If you want to use use node:process then you should look into hrtime.bugint()
Anothe thing here that you get nanoseconds
and then you've added additional check
and division
to get milliseconds
and after all you are rounding
value. Why? Will it be more easy to use Data.now()
and calculate difference between it? Simple it could be achieved in 2 rows const start = Date.now()
and commandExecution.executionTime = Date.now() - statrt
. That is it.
…ub.com/RedisInsight/RedisInsight into feature/RI-3751_command_execution_time
…ub.com/RedisInsight/RedisInsight into feature/RI-3751_command_execution_time
.toEqual(mockCommandExecutionToRun); | ||
const result = await service.createCommandExecution(mockClientOptions, mockCreateCommandExecutionDto); | ||
// can't predict execution time | ||
expect(result).toMatchObject(mockCommandExecutionToRun); |
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.
toMatchObject
nice! didn't know this useful feature :)
…ub.com/RedisInsight/RedisInsight into feature/RI-3751_command_execution_time
…ion-time E2e/feature/ri 3751 execution time
No description provided.