gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r5294 - GNUnet/src/applications/sqstore_mysql


From: gnunet
Subject: [GNUnet-SVN] r5294 - GNUnet/src/applications/sqstore_mysql
Date: Mon, 9 Jul 2007 22:03:47 -0600 (MDT)

Author: grothoff
Date: 2007-07-09 22:03:47 -0600 (Mon, 09 Jul 2007)
New Revision: 5294

Modified:
   GNUnet/src/applications/sqstore_mysql/mysql.c
Log:
timing

Modified: GNUnet/src/applications/sqstore_mysql/mysql.c
===================================================================
--- GNUnet/src/applications/sqstore_mysql/mysql.c       2007-07-09 14:55:17 UTC 
(rev 5293)
+++ GNUnet/src/applications/sqstore_mysql/mysql.c       2007-07-10 04:03:47 UTC 
(rev 5294)
@@ -305,6 +305,7 @@
   char * dbname;
   my_bool reconnect = 0;
   unsigned int timeout = 60; /* in seconds */
+  cron_t start;
 
   if (dbhI->cnffile == NULL)
     return SYSERR;
@@ -432,6 +433,7 @@
       dbhI->dbf = NULL;
       return SYSERR;
     }
+    start = get_time();
     if (mysql_stmt_prepare(dbhI->insert,
                           INSERT_SAMPLE,
                           strlen(INSERT_SAMPLE)) ||
@@ -458,7 +460,7 @@
                           strlen(DELETE_GENERIC_SAMPLE)) ) {
       GE_LOG(ectx, 
             GE_ERROR | GE_BULK | GE_USER,
-            _("`%s' failed at %s:%d with error: I/%s S/%s SC/%s SS/%s SSC/%s 
U/%s D/%s DG/%s\n"),
+            _("`%s' failed at %s:%d with error: I/%s S/%s SC/%s SS/%s SSC/%s 
U/%s D/%s DG/%s after %llums\n"),
             "mysql_stmt_prepare",
             __FILE__, __LINE__,
             mysql_stmt_error(dbhI->insert),
@@ -468,7 +470,8 @@
             mysql_stmt_error(dbhI->selectsc),
             mysql_stmt_error(dbhI->update),
             mysql_stmt_error(dbhI->deleteh),
-            mysql_stmt_error(dbhI->deleteg));
+            mysql_stmt_error(dbhI->deleteg),
+            get_time() - start);
       mysql_stmt_close(dbhI->insert);
       mysql_stmt_close(dbhI->select);
       mysql_stmt_close(dbhI->selectc);
@@ -600,7 +603,7 @@
   mysql_query(dbhI.dbf,
         "SET AUTOCOMMIT = 0");
   mysql_query(dbhI.dbf,
-        "SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED");
+        "SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED");
   if (type==0) {
     typestr[0] = '\0';
   } else {
@@ -1375,6 +1378,7 @@
                  cron_t expire) {
   unsigned long contentSize;
   unsigned long twenty;
+  cron_t start;
 
   twenty = sizeof(HashCode512);
   MUTEX_LOCK(lock);
@@ -1412,13 +1416,15 @@
    * will generate a warning though, but its probably not seen
    * at all in this context.)
    */
+  start = get_time();
   if (mysql_stmt_execute(dbh->update)) {
     GE_LOG(ectx,
           GE_ERROR | GE_BULK | GE_USER,
-          _("`%s' failed at %s:%d with error: %s\n"),
+          _("`%s' failed at %s:%d with error `%s' after %llums\n"),
           "mysql_stmt_execute",
           __FILE__, __LINE__,
-          mysql_stmt_error(dbh->update));
+          mysql_stmt_error(dbh->update),
+          get_time() - start);
     iclose(dbh);
     mysql_thread_end();
     MUTEX_UNLOCK(lock);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]