From d7347ad7877139ce9da59cca55ac3efd91216f6b Mon Sep 17 00:00:00 2001 From: Marc Cromme Date: Thu, 15 Sep 2005 10:38:03 +0000 Subject: [PATCH] made progres linearly increasing, and added gnuplot file --- zoom/zoom-benchmark.c | 29 ++++++++++++++++++++++------- zoom/zoom-benchmark.gpt | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 7 deletions(-) create mode 100644 zoom/zoom-benchmark.gpt diff --git a/zoom/zoom-benchmark.c b/zoom/zoom-benchmark.c index bb7d51c..ca6a5b4 100644 --- a/zoom/zoom-benchmark.c +++ b/zoom/zoom-benchmark.c @@ -1,5 +1,5 @@ /* - * $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 */ @@ -23,8 +23,9 @@ static int zoom_progress[10]; /* 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; @@ -61,6 +62,13 @@ void init_statics() //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 @@ -196,7 +204,8 @@ int main(int argc, char **argv) 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))) @@ -207,15 +216,21 @@ int main(int argc, char **argv) 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); diff --git a/zoom/zoom-benchmark.gpt b/zoom/zoom-benchmark.gpt new file mode 100644 index 0000000..7446eb5 --- /dev/null +++ b/zoom/zoom-benchmark.gpt @@ -0,0 +1,34 @@ + +# +# $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 + + -- 1.7.10.4