Getting Health of a Session?

39 views
Skip to first unread message

Jacob

unread,
Nov 3, 2016, 11:40:02 AM11/3/16
to DataStax C++ Driver for Apache Cassandra User Mailing List
Is there a way to poll a Session to get the status? I didn't see anything in cassandra.h. I'm using driver version 2.3.0.

Michael Fero

unread,
Nov 3, 2016, 2:14:29 PM11/3/16
to DataStax C++ Driver for Apache Cassandra User Mailing List
Jacob,

You can get performance metrics and diagnostic information by requesting a snapshot:

CassMetrics metrics;
cass_session_get_metrics(session, &metrics);

http://datastax.github.io/cpp-driver/topics/metrics/

~Fero

Jacob

unread,
Dec 15, 2016, 5:31:05 PM12/15/16
to DataStax C++ Driver for Apache Cassandra User Mailing List

Thanks Fero. Is there a way to get more information on which of the current connections is unavailable? We would like to be able to report the status of each Node from our application.

Michael Fero

unread,
Dec 21, 2016, 8:43:39 AM12/21/16
to DataStax C++ Driver for Apache Cassandra User Mailing List

Jacob,

Unfortunately that is not possible with the driver currently. You could parse the log messages from the driver (CASS_LOG_TRACE) and monitor the connects and disconnects from a particular host in your application using the callback mechanism.

Feel free to create a ticket (https://datastax-oss.atlassian.net/browse/CPP) and/or generate a pull request; contributions are always welcome.

~Fero

Reply all
Reply to author
Forward
0 new messages