dovecot-2.2: cassandra: With debugging, log also how many rows w...

dovecot at dovecot.org dovecot at dovecot.org
Wed Sep 16 22:28:25 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/7fc709a7b5a5
changeset: 19153:7fc709a7b5a5
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Sep 17 07:26:49 2015 +0900
description:
cassandra: With debugging, log also how many rows were iterated.

diffstat:

 src/lib-sql/driver-cassandra.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (29 lines):

diff -r ffb377cccd22 -r 7fc709a7b5a5 src/lib-sql/driver-cassandra.c
--- a/src/lib-sql/driver-cassandra.c	Thu Sep 17 07:24:28 2015 +0900
+++ b/src/lib-sql/driver-cassandra.c	Thu Sep 17 07:26:49 2015 +0900
@@ -65,6 +65,7 @@
 	char *error;
 	enum cassandra_query_type query_type;
 	struct timeval start_time, finish_time;
+	unsigned int row_count;
 
 	pool_t row_pool;
 	ARRAY_TYPE(const_string) fields;
@@ -468,7 +469,8 @@
 	if (db->log_level >= CASS_LOG_DEBUG) {
 		if (gettimeofday(&now, NULL) < 0)
 			i_fatal("gettimeofday() failed: %m");
-		i_debug("cassandra: Finished query '%s' (%lld+%lld us): %s", result->query,
+		i_debug("cassandra: Finished query '%s' (%u rows, %lld+%lld us): %s", result->query,
+			result->row_count,
 			timeval_diff_usecs(&result->finish_time, &result->start_time),
 			timeval_diff_usecs(&now, &result->finish_time),
 			result->error != NULL ? result->error : "success");
@@ -745,6 +747,7 @@
 
 	if (!cass_iterator_next(result->iterator))
 		return 0;
+	result->row_count++;
 
 	p_clear(result->row_pool);
 	p_array_init(&result->fields, result->row_pool, 8);


More information about the dovecot-cvs mailing list