diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-10-28 13:32:17 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-10-28 13:32:17 +0200 |
commit | 6a642f8f6060018115be1bf66826fc1c4676a015 (patch) | |
tree | 850d75e2e506431b93c8af608bcddff184bf91ad /src | |
parent | 196b6bc57fc6100ce99b28a3898ff947b05edc18 (diff) | |
download | gnunet-6a642f8f6060018115be1bf66826fc1c4676a015.tar.gz gnunet-6a642f8f6060018115be1bf66826fc1c4676a015.zip |
add logging for DB perf analysis
Diffstat (limited to 'src')
-rw-r--r-- | src/pq/pq.c | 5 | ||||
-rw-r--r-- | src/pq/pq_exec.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/pq/pq.c b/src/pq/pq.c index b260aa1db..876d4fcf6 100644 --- a/src/pq/pq.c +++ b/src/pq/pq.c | |||
@@ -95,6 +95,11 @@ GNUNET_PQ_exec_prepared (struct GNUNET_PQ_Context *db, | |||
95 | param_lengths, | 95 | param_lengths, |
96 | param_formats, | 96 | param_formats, |
97 | 1); | 97 | 1); |
98 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, | ||
99 | "pq", | ||
100 | "Execution of prepared SQL statement `%s' finished (%d)\n", | ||
101 | name, | ||
102 | PGRES_COMMAND_OK == PQresultStatus (res)); | ||
98 | if ( (PGRES_COMMAND_OK != PQresultStatus (res)) && | 103 | if ( (PGRES_COMMAND_OK != PQresultStatus (res)) && |
99 | (CONNECTION_OK != (status = PQstatus (db->conn))) ) | 104 | (CONNECTION_OK != (status = PQstatus (db->conn))) ) |
100 | { | 105 | { |
diff --git a/src/pq/pq_exec.c b/src/pq/pq_exec.c index 464fff4b4..dcde331b6 100644 --- a/src/pq/pq_exec.c +++ b/src/pq/pq_exec.c | |||
@@ -86,6 +86,11 @@ GNUNET_PQ_exec_statements (struct GNUNET_PQ_Context *db, | |||
86 | db); | 86 | db); |
87 | result = PQexec (db->conn, | 87 | result = PQexec (db->conn, |
88 | es[i].sql); | 88 | es[i].sql); |
89 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
90 | "Running statement `%s' on %p finished (%d)\n", | ||
91 | es[i].sql, | ||
92 | db, | ||
93 | PGRES_COMMAND_OK == PQresultStatus (result)); | ||
89 | if ((GNUNET_NO == es[i].ignore_errors) && | 94 | if ((GNUNET_NO == es[i].ignore_errors) && |
90 | (PGRES_COMMAND_OK != PQresultStatus (result))) | 95 | (PGRES_COMMAND_OK != PQresultStatus (result))) |
91 | { | 96 | { |