-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
The nds and nds-h power scripts can report an inaccurate number for the "Power Test Time" especially when the test finishes too quickly. Sometimes a negative number is reported as the test time. This is because we use int(time.time()) to measure the timing. The use of int(time.time()) has a couple of issues. See https://docs.python.org/3/library/time.html#time.time for more details.
time.time()returns the unix time in seconds as a float, which can cause precision loss.- The
intcasting will drop the fractional seconds.
We should use time.time_ns() instead to improve the accuracy.
Steps/Code to reproduce bug
Run some query that finishes very quickly, such as SELECT 1.
Expected behavior
The test time should be as accurate as possible. The test time should never be negative numbers.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working