@echo DEBUG: shell: x$(shell echo ${mysql_version} | cut -d. -f1,2)x
${LINK} -o $@ lbproxy.o fake_write2rgma.o ${LB_PROXY_LIBS}
+glite_lb_proxy_perf: lbproxy.o fake_write2rgma.o ${STATIC_LIB_BK}
+ ${LINK} -o $@ lbproxy.o fake_write2rgma.o ${LB_PROXY_LIBS}
+
default all: compile
compile: glite_lb_proxy
#include "glite/lb/context-int.h"
#ifdef LB_PERF
#include "glite/lb/lb_perftest.h"
+#include "glite/lb/srv_perf.h"
+
+enum lb_srv_perf_sink sink_mode;
#endif
extern int edg_wll_DBCheckVersion(edg_wll_Context);
{"pidfile", 1, NULL, 'i'},
{"proxy-il-sock", 1, NULL, 'X'},
{"proxy-il-fprefix", 1, NULL, 'Y'},
+#ifdef LB_PERF
+ {"perf-sink", 1, NULL, 'K'},
+#endif
{NULL,0,NULL,0}
};
-static const char *get_opt_string = "p:c:dm:s:l:i:X:Y:z";
+static const char *get_opt_string = "p:c:dm:s:l:i:X:Y:z"
+#ifdef LB_PERF
+ "K:"
+#endif
+;
static void usage(char *me)
{
"\t--proxy-il-sock\t socket to send events to\n"
"\t--proxy-il-fprefix\t file prefix for events\n"
"\t--silent\t don't print diagnostic, even if -d is on\n"
+#ifdef LB_PERF
+ "\t--perf-sink\t where to sink events\n"
+#endif
,me);
}
case 'X': lbproxy_ilog_socket_path = strdup(optarg); break;
case 'Y': lbproxy_ilog_file_prefix = strdup(optarg); break;
case 'i': strcpy(pidfile, optarg); break;
+#ifdef LB_PERF
+ case 'K': sink_mode = atoi(optarg); break;
+#endif
case '?': usage(name); return 1;
}
if [ x${LB_STANDALONE} = x ]; then \
${INSTALL} -m 755 ${PLUGIN_LIB} ${PREFIX}/lib; \
fi; \
+ ${INSTALL} -m 644 ${top_srcdir}/interface/srv_perf.h ${PREFIX}/include/${globalprefix}/${lbprefix}; \
fi
clean:
--- /dev/null
+enum lb_srv_perf_sink {
+ GLITE_LB_SINK_NONE = 0,
+ GLITE_LB_SINK_PARSE,
+ GLITE_LB_SINK_STORE,
+ GLITE_LB_SINK_STATE,
+ GLITE_LB_SINK_SEND,
+};
+
+
+extern enum lb_srv_perf_sink sink_mode;
#include "glite/lb/context-int.h"
#include "glite/lb/lb_maildir.h"
+#ifdef LB_PERF
+#include "glite/lb/lb_perftest.h"
+#include "glite/lb/srv_perf.h"
+
+enum lb_srv_perf_sink sink_mode;
+#endif
+
#include "lb_http.h"
#include "lb_proto.h"
#include "index.h"
{"count-statistics", 1, NULL, 'T'},
{"request-timeout", 1, NULL, 't'},
{"silent", 0, NULL, 'z' },
+#ifdef LB_PERF
+ {"perf-sink", 1, NULL, 'K'},
+#endif
{NULL,0,NULL,0}
};
+static const char *get_opt_string = "a:c:k:C:V:p:drm:ns:l:L:N:i:S:D:X:Y:T:t:J:jz"
#ifdef GLITE_LB_SERVER_WITH_WS
-static const char *get_opt_string = "a:c:k:C:V:p:w:drm:ns:l:L:N:i:S:D:X:Y:T:t:J:jz";
-#else
-static const char *get_opt_string = "a:c:k:C:V:p:drm:ns:l:L:N:i:S:D:X:Y:T:t:J:jz";
-#endif /* GLITE_LB_SERVER_WITH_WS */
+ "w:"
+#endif
+#ifdef LB_PERF
+ "K:"
+#endif
+;
static void usage(char *me)
{
"\t--count-statistics=1\t count certain statistics on jobs\n"
"\t =2\t ... and allow anonymous access\n"
"\t--silent\t don't print diagnostic, even if -d is on\n"
+#ifdef LB_PERF
+ "\t--perf-sink\t where to sink events\n"
+#endif
+
,me);
}
#include "lock.h"
#include "il_lbproxy.h"
+#ifdef LB_PERF
+#include "glite/lb/lb_perftest.h"
+#include "glite/lb/srv_perf.h"
+#endif
+
+
/* XXX */
#define use_db 1
if(edg_wll_ParseEvent(ctx, event, &ev))
goto err;
+#ifdef LB_PERF
+ if (sink_mode == GLITE_LB_SINK_STORE) {
+ glite_wll_perftest_consumeEvent(ev);
+ edg_wll_FreeEvent(ev);
+ free(ev);
+ return 0;
+ }
+#endif
+
+
/* XXX: if event type is user tag, convert the tag name to lowercase!
* (not sure whether to convert a value too is reasonable
* or keep it 'case sensitive')
ev->changeACL.user_id, ev->changeACL.user_id_type,
ev->changeACL.permission, ev->changeACL.permission_type,
ev->changeACL.operation);
- else
+ else {
+#ifdef LB_PERF
+ if(sink_mode == GLITE_LB_SINK_STATE) {
+ glite_wll_perftest_consumeEvent(ev);
+ edg_wll_UnlockJob(ctx,ev->any.jobId);
+ goto err;
+ }
+#endif
+
err = edg_wll_StepIntState(ctx,ev->any.jobId, ev, seq, ctx->isProxy? NULL: &newstat);
+ }
if (edg_wll_UnlockJob(ctx,ev->any.jobId)) goto err;
if (err) goto err;
#include "store.h"
+#ifdef LB_PERF
+#include "srv_perf.h"
+#endif
+
static
int
ret = read_il_data(ctx, &buf, gss_plain_reader);
if ( ret < 0 ) return(ret);
#ifdef LB_PERF
- glite_wll_perftest_consumeEventIlMsg(buf);
-#else
+ if (sink_mode == GLITE_LB_SINK_PARSE) glite_wll_perftest_consumeEventIlMsg(buf);
+ else
+#endif
if ( !(ret = handle_request(ctx, buf)) ) {
if ( (err = edg_wll_Error(ctx, NULL, &errd)) ) edg_wll_ResetError(ctx);
}
-#endif
free(buf);