no debug
[oweals/gnunet.git] / src / datastore / perf_datastore_api.c
index 4ba8216bf89bd8a4e292034b44e2ce5619edf35b..90cdf44b334f7686aef88719494493108b688686 100644 (file)
@@ -4,7 +4,7 @@
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
@@ -140,7 +140,6 @@ check_success (void *cls,
        crc->phase = RP_CUT;
     }
   GNUNET_SCHEDULER_add_continuation (crc->sched,
-                                    GNUNET_NO,
                                     &run_continuation,
                                     crc,
                                     GNUNET_SCHEDULER_REASON_PREREQ_DONE);
@@ -167,7 +166,6 @@ remove_next(void *cls,
 #endif
   GNUNET_assert (GNUNET_OK == success);
   GNUNET_SCHEDULER_add_continuation (crc->sched,
-                                    GNUNET_NO,
                                     &run_continuation,
                                     crc,
                                     GNUNET_SCHEDULER_REASON_PREREQ_DONE);
@@ -188,9 +186,9 @@ do_delete (void *cls,
                           &crc->key,
                           crc->esize,
                           crc->data,
+                          1, 1, TIMEOUT,
                           &remove_next,
-                          crc,
-                          TIMEOUT);
+                          crc);
 }
 
 
@@ -200,7 +198,7 @@ delete_value (void *cls,
              const GNUNET_HashCode * key,
              uint32_t size,
              const void *data,
-             uint32_t type,
+             enum GNUNET_BLOCK_Type type,
              uint32_t priority,
              uint32_t anonymity,
              struct GNUNET_TIME_Absolute
@@ -214,18 +212,15 @@ delete_value (void *cls,
        {
          crc->phase = RP_REPORT;
          GNUNET_SCHEDULER_add_continuation (crc->sched,
-                                            GNUNET_NO,
                                             &run_continuation,
                                             crc,
                                             GNUNET_SCHEDULER_REASON_PREREQ_DONE);
          return;     
        }
-      GNUNET_SCHEDULER_add_after (crc->sched,
-                                 GNUNET_NO,
-                                 GNUNET_SCHEDULER_PRIORITY_HIGH,
-                                 GNUNET_SCHEDULER_NO_TASK,
-                                 &do_delete,
-                                 crc);
+      GNUNET_SCHEDULER_add_with_priority (crc->sched,
+                                         GNUNET_SCHEDULER_PRIORITY_HIGH,
+                                         &do_delete,
+                                         crc);
       return;
     }
   stored_ops++;
@@ -280,16 +275,16 @@ run_continuation (void *cls,
                            GNUNET_TIME_relative_to_absolute 
                            (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
                                                            GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 1000))),
-                           TIMEOUT,
+                           1, 1, TIMEOUT,
                            &check_success, 
                            crc);
       break;
     case RP_CUT:
       /* trim down below MAX_SIZE again */
       GNUNET_DATASTORE_get_random (datastore, 
+                                  1, 1, TIMEOUT,
                                   &delete_value,
-                                  crc,
-                                  TIMEOUT);
+                                  crc);
       break;
     case RP_REPORT:
       printf (
@@ -303,7 +298,6 @@ run_continuation (void *cls,
       crc->phase = RP_PUT;
       crc->j = 0;
       GNUNET_SCHEDULER_add_continuation (crc->sched,
-                                        GNUNET_NO,
                                         &run_continuation,
                                         crc,
                                         GNUNET_SCHEDULER_REASON_PREREQ_DONE);
@@ -313,6 +307,8 @@ run_continuation (void *cls,
       GNUNET_free (crc);
       ok = 0;
       break;
+    default:
+      GNUNET_assert (0);      
     }
 }
 
@@ -333,7 +329,6 @@ run (void *cls,
   crc->cfg = cfg;
   crc->phase = RP_PUT;
   GNUNET_SCHEDULER_add_continuation (crc->sched,
-                                    GNUNET_NO,
                                     &run_continuation,
                                     crc,
                                     GNUNET_SCHEDULER_REASON_PREREQ_DONE);
@@ -356,13 +351,12 @@ check ()
   struct GNUNET_GETOPT_CommandLineOption options[] = {
     GNUNET_GETOPT_OPTION_END
   };
-  pid = GNUNET_OS_start_process ("gnunet-service-datastore",
-                                 "gnunet-service-datastore",
+  pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
+                                 "gnunet-service-arm",
 #if VERBOSE
                                  "-L", "DEBUG",
 #endif
                                  "-c", "test_datastore_api_data.conf", NULL);
-  sleep (1);
   GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
                       argv, "perf-datastore-api", "nohelp",
                       options, &run, NULL);
@@ -381,7 +375,7 @@ main (int argc, char *argv[])
 {
   int ret;
 
-  GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-datastore");
+  GNUNET_DISK_directory_remove ("/tmp/test-gnunet-datastore");
   GNUNET_log_setup ("perf-datastore-api",
 #if VERBOSE
                    "DEBUG",
@@ -393,7 +387,7 @@ main (int argc, char *argv[])
 #if REPORT_ID
   fprintf (stderr, "\n");
 #endif
-  GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-datastore");
+  GNUNET_DISK_directory_remove ("/tmp/test-gnunet-datastore");
   return ret;
 }