/*
- * $Id: zoom-benchmark.c,v 1.4 2005-09-11 20:21:27 adam Exp $
+ * $Id: zoom-benchmark.c,v 1.5 2005-09-15 10:38:03 marc Exp $
*
* Asynchronous multi-target client doing search and piggyback retrieval
*/
/* commando line parameters */
static struct parameters_t {
- char host[1024];
- char query[1024];
+ char host[4096];
+ char query[4096];
+ char progress[4096];
int concurrent;
int timeout;
} parameters;
//parameters.query = "";
parameters.concurrent = 1;
parameters.timeout = 0;
+
+ /* progress initializing */
+ int i;
+ for (i = 0; i < 4096; i++){
+ parameters.progress[i] = 0;
+ }
+
}
struct time_type
r[i] = ZOOM_connection_search_pqf (z[i], parameters.query);
// print header of table
- printf ("second.usec\ttarget\tprogress\tevent\teventname\terror\terrorname\n");
+ printf ("second.usec\ttarget\tprogress\tevent\teventname\t");
+ printf("error\terrorname\n");
time_init(&time);
/* network I/O. pass number of connections and array of connections */
while ((i = ZOOM_event (parameters.concurrent, z)))
int error = 0;
int progress = zoom_progress[event];
+ if (event == ZOOM_EVENT_SEND_DATA | event == ZOOM_EVENT_RECV_DATA)
+ continue;
+
+
time_stamp(&time);
error = ZOOM_connection_error(z[i-1] , &errmsg, &addinfo);
if (error)
- progress = -progress;
-
+ parameters.progress[i] = -progress;
+ else
+ parameters.progress[i] += 1;
+
printf ("%ld.%06ld\t%d\t%d\t%d\t%s\t%d\t%s\n",
time_sec(&time), time_usec(&time),
- i-1, progress,
+ i-1, parameters.progress[i],
event, zoom_events[event],
error, errmsg);
--- /dev/null
+
+#
+# $Id: zoom-benchmark.gpt,v 1.1 2005-09-15 10:38:03 marc Exp $
+#
+
+set title "Z39.50 connection plot"
+#set style data fsteps
+set xlabel "Time Seconds"
+set ylabel "Progress"
+#set timefmt "%d/%m/%y\t%H%M"
+set yrange [ -9 : ]
+#set xdata time
+#set xrange [ "1/6/93":"1/11/93" ]
+#set ylabel "Concentration\nmg/l"
+#set format x "%d/%m\n%H:%M"
+set grid
+#set multiplot
+#set key left
+#plot 'out.txt' using 1:3 t '', \
+# 'out.txt' using 1:3 t 'Total P' with points, \
+# 'out.txt' using 1:4 t '', \
+# 'out.txt' using 1:4 t 'PO4' with points
+
+#if ( $2 = 3 ) plot 'out.txt' using 1:3
+#plot 'out.txt' using ($1):($2==3 ? $3 : 1/0)
+#plot 'out.txt' using 1:3 t '' with points
+#plot 'out.txt' using ($1):($3) t '' with points
+plot 'out.txt' using ($1):($3) t '' with lines
+pause -1 "Hit return to continue"
+
+
+reset
+
+