Skip to content
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

Sub-Millisecond latencies are reported as taking 0 milliseconds #41

Closed
mikewied opened this issue Oct 14, 2011 · 4 comments
Closed

Sub-Millisecond latencies are reported as taking 0 milliseconds #41

mikewied opened this issue Oct 14, 2011 · 4 comments

Comments

@mikewied
Copy link
Contributor

Many NoSQL databases are able to produce responses in less than a millisecond. When this happens YCSB places the result in the 0 millisecond slot in the histogram array and the latency value not increased (since the latency is reported as zero) and the operations variable is incremented. As a result this causes data for some datastores to be skewed. I suggest using System.nanoTime() and then dividing by 1000 to get the time in microseconds. The histogram will still look the same, but the average latency reported will be much more accurate. Then the documentation could be updated to say that when reading the histogram the value for each slot is between the time of that slot and the next greatest slots time. For example, if there were 1000 operations that were recorded in the 0 slot in the histogram then we would interpret that as "1000 operation completed in less than 1 millisecond, but greater than 0 milliseconds.

Also, for machines that cannot produce time results in the microsecond range we could log a warning that says that that granularity is not supported. I can also submit a patch for this if you are open to the idea.

@ghost
Copy link

ghost commented Oct 16, 2011

Hi Mike,

This is a great idea. Please go ahead and submit a patch.

Thanks!
--Michi

@ghost ghost closed this as completed Oct 16, 2011
@ghost ghost reopened this Oct 16, 2011
@ghost
Copy link

ghost commented Oct 16, 2011

... Oops. I didn't mean to close the issue.

@mikewied
Copy link
Contributor Author

I just submitted a patch (pull request) for this.

@ghost
Copy link

ghost commented Oct 17, 2011

Merged to master. Thank you for the patch, Mike!

--Michi

@ghost ghost closed this as completed Oct 17, 2011
This issue was closed.
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

No branches or pull requests

1 participant