* empty interlogger for performance tests
authorMichal Voců <michal@ruk.cuni.cz>
Tue, 9 May 2006 20:40:51 +0000 (20:40 +0000)
committerMichal Voců <michal@ruk.cuni.cz>
Tue, 9 May 2006 20:40:51 +0000 (20:40 +0000)
org.glite.lb.logger/src/il_master.c
org.glite.lb.logger/src/interlogd.c

index b045112..e127af6 100644 (file)
 
 #include "interlogd.h"
 
+#ifdef LB_PERF
+#include "glite/lb/lb_perftest.h"
+#endif
+
 int 
 enqueue_msg(struct event_queue *eq, struct server_msg *msg)
 {
@@ -392,7 +396,9 @@ loop()
                        if(error_get_maj() == IL_PROTO) {
                                il_log(LOG_DEBUG, "  premature EOF while receiving event\n");
                                /* problems with socket input, try to catch up from files */
+#ifndef PERF_EMPTY
                                event_store_recover_all();
+#endif
                                continue;
                        } else 
                                return(-1);
@@ -401,6 +407,12 @@ loop()
                        continue;
                }
 
+#ifdef PERF_EMPTY
+               glite_wll_perftest_consumeEventString(msg);
+               free(msg);
+               continue;
+#endif
+
 #ifdef INTERLOGD_HANDLE_CMD            
                ret = handle_cmd(msg, offset);
                if(ret == 0)
index d2d53b3..6b9de88 100644 (file)
@@ -14,6 +14,9 @@
 #include "interlogd.h"
 #include "glite/lb/consumer.h"
 #include "glite/security/glite_gss.h"
+#ifdef LB_PERF
+#include "glite/lb/lb_perftest.h"
+#endif
 
 #define EXIT_FAILURE 1
 #if defined(IL_NOTIFICATIONS)
@@ -206,6 +209,11 @@ main (int argc, char **argv)
     exit(EXIT_FAILURE);
   }
 
+#ifdef LB_PERF
+  /* this must be called after installing signal handlers */
+  glite_wll_perftest_init();
+#endif
+
   il_log(LOG_INFO, "Initializing input queue...\n");
   if(input_queue_attach() < 0) {
     il_log(LOG_CRIT, "Failed to initialize input queue: %s\n", error_get_msg());
@@ -250,6 +258,7 @@ main (int argc, char **argv)
        exit(EXIT_FAILURE);
   }
 
+#ifndef PERF_EMPTY
   /* find all unsent events waiting in files */
   { 
          pthread_t rid;
@@ -261,6 +270,7 @@ main (int argc, char **argv)
          }
          pthread_detach(rid);
   }
+#endif
 
   il_log(LOG_INFO, "Entering main loop...\n");