1) Is there a way to log the queries executed in Cassandra?
2) For performance, I understand TracingON in cqlsh is a good feature for tracing the single query we execute in cqlsh. But Is there a way to profile the Cassandra queries which gives the execution time, query data size etc.,
Asked
Active
Viewed 686 times
1

Vadim Kotov
- 8,084
- 8
- 48
- 62

Harry
- 3,072
- 6
- 43
- 100
1 Answers
2
Tracing isn't just limited to CQL. You could enable the same behavior from Java code as well.
Set the tracing flag on the Statement instance. There are various ways depending on how you build it:
// Setter-based:
Statement statement =
SimpleStatement.newInstance("SELECT * FROM users WHERE id = 1234").setTracing(true);
// Builder-based:
Statement statement =
SimpleStatement.builder("SELECT * FROM users WHERE id = 1234").withTracing().build();
Here is the detailed reference

dilsingi
- 2,938
- 14
- 24
-
Is it available only for Java driver (or) Is it also available for c++ or nodejs driver? – Harry May 10 '18 at 13:40
-
Because am not able to find for c++ driver – Harry May 11 '18 at 04:43
-
can you please check this : https://stackoverflow.com/questions/50385262/cassandra-commit-log-size – Harry May 17 '18 at 07:18
-
please check this : https://stackoverflow.com/questions/50432926/native-transport-requests-in-cassandra – Harry May 20 '18 at 08:41