Skip to content

Slow Query Logger (JAVA-646)#306

Merged
olim7t merged 2 commits into
2.0from
java646
Mar 31, 2015
Merged

Slow Query Logger (JAVA-646)#306
olim7t merged 2 commits into
2.0from
java646

Conversation

@adutra
Copy link
Copy Markdown
Contributor

@adutra adutra commented Mar 24, 2015

No description provided.

@olim7t
Copy link
Copy Markdown
Contributor

olim7t commented Mar 24, 2015

#305 needs to be merged before this one.

@adutra adutra force-pushed the java646 branch 3 times, most recently from 750eda0 to 87ffbe5 Compare March 24, 2015 16:10
@olim7t
Copy link
Copy Markdown
Contributor

olim7t commented Mar 24, 2015

We should also consider modifying LatencyAwarePolicy to take advantage of the new exception parameter. Some errors like client timeouts should still count towards a hosts' estimated "responsiveness", but others probably shouldn't (see also JAVA-698).

@adutra
Copy link
Copy Markdown
Contributor Author

adutra commented Mar 25, 2015

Agreed. Do you want me to amend this PR or should I open a separate ticket? We need to decide which exceptions should be taken into account and which of them shouldn't.

@olim7t
Copy link
Copy Markdown
Contributor

olim7t commented Mar 25, 2015

Let's do it on the same branch.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe we should be smarter than this for BLOBs. If we get a 100K blob, we're going to convert it to a string at line 467, then find out that this string is too long and truncate it.
Instead, we should check the ByteBuffer's capacity first and, if it's too long, slice() the part we're going to print and pass that to format. The size of the string is 2 + 2 * sizeOfBuffer (the initial 2 is for the "0x" prefix).
This is less of an issue for other datatypes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch. I will do that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As requested, the builder now takes a Cluster param in anticipation of future use.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doc needs update at line 38 for this

@tolbertam
Copy link
Copy Markdown
Contributor

Excellent test coverage! I had a few comments about comments and added a few tests of my own, but this is looking pretty good!

@adutra adutra force-pushed the java646 branch 2 times, most recently from 40d099e to 9912827 Compare March 31, 2015 11:10
@adutra
Copy link
Copy Markdown
Contributor Author

adutra commented Mar 31, 2015

@tolbertam I had to do a rebase today and want to make sure I didn't miss any of your additions: I saw a new test in LatencyAwarePolicyTest so far. Is there anything else?

@tolbertam
Copy link
Copy Markdown
Contributor

Hi @adutra, the other test was QueryLoggerTest#should_log_counter_batch_statements. It looks like that shows up in the commits, so that's good :)

@tolbertam
Copy link
Copy Markdown
Contributor

Looks good to me! Would you mind amending the last commit to fit within the text restriction for the first line of the commit? (I think it's around 72 characters). Other than that everything looks great and I would say it's good to merge from my perspective! 👍

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