chiark / gitweb /
routesearch: event counters
[ypp-sc-tools.db-live.git] / yarrg / rsmain.c
index 0982889c8b3f8fc34d2c25e9fb4fe314f3d79a84..da05f4780fb30ed0256b684aee3c7cea241f5477 100644 (file)
@@ -7,6 +7,10 @@ double max_mass=-1, max_volu=-1, max_capi=-1;
 double distance_loss_factor_per_league;
 int max_dist= -1;
 
+#define CTR(x) int ctr_##x;
+  COUNTER_LIST
+#undef CTR
+
 int main(int argc, const char **argv) {
   const char *arg;
 
@@ -28,10 +32,6 @@ int main(int argc, const char **argv) {
     }
   }
 
-  setup_sql();
-  setup_value();
-  setup_search();
-
   max_mass= atof(*argv++);
   max_volu= atof(*argv++);
   max_capi= atof(*argv++);
@@ -39,6 +39,12 @@ int main(int argc, const char **argv) {
 
   if (!loss_per_league) loss_per_league= 1e-7;
   distance_loss_factor_per_league= 1.0 - loss_per_league;
+
+  setup_sql();
+  setup_value();
+  setup_search();
+
+  fprintf(stderr,"setup complete, starting search\n");
   
   arg= *argv++;
   if (!strcmp(arg,"specific")) {
@@ -55,5 +61,10 @@ int main(int argc, const char **argv) {
   } else {
     abort();
   }
+
+#define CTR(x) fprintf(stderr,"  %-30s %10d\n",#x,ctr_##x);
+  COUNTER_LIST
+#undef CTR
+
   return 0;
 }