[httperf] patch to httperf-0.8

David Viner dviner@yahoo-inc.com
Fri, 22 Mar 2002 10:47:55 -0800


This is a multi-part message in MIME format.

------=_NextPart_000_0023_01C1D18F.064A84C0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

hi all,
  i think httperf is great, but parsing the output is kind of difficult
right now.  so i've made a patch which adds a new command line
parameter --output-xml.  when specified, the output looks like:


httperf --hog --timeout=1 --client=0/1 --server=quintara.corp.yahoo.com --po
rt=80 --uri=/test/page.php --send-buffer=4096 --recv-buffer=16384 --num-conn
s=1000 --num-calls=1 --output-xml
Maximum connect burst length: 1
<results>
<totals>
        <total type="connections">1000</total>
        <total type="requests">1000</total>
        <total type="replies">1000</total>
        <total type="test_duration">14.788</total>
</totals>

<connection concurrent_conns="1">
        <rate unit="conns/sec">67.6</rate>
        <rate unit="ms/conn">14.8</rate>
        <time desc="connection lifetime" unit="ms" min="13.4" avg="14.8"
max="81.7" median="13.5" stddev="5.2" />
        <time desc="time to connect" unit="ms">0.2</time>
        <rate unit="replies/conn">1.000</rate>
</connection>

<request>
        <rate unit="req/s">67.6</rate>
        <rate unit="ms/req">14.8</rate>
        <size unit="byte">87.0</size>
</request>

<reply unit="replies/s" min="56.8" avg="64.9" max="73.0" stddev="11.5"
samples="2">
        <times unit="ms">
                <time type="response">10.9</time>
                <time type="transfer">3.6</time>
        </times>
        <sizes unit="bytes">
                <size type="header">339.0</size>
                <size type="content">39519.0</size>
                <size type="footer">2.0</size>
                <size type="total">39860.0</size>
        </sizes>
        <status>
                <stat unit="1xx">0</stat>
                <stat unit="2xx">1000</stat>
                <stat unit="3xx">0</stat>
                <stat unit="4xx">0</stat>
                <stat unit="5xx">0</stat>
        </status>
</reply>

<cpu>
        <time unit="s" pct="99.9%">
                <user pct="31.4%">4.65</user>
                <system pct="68.5%">10.13</system>
        </time>
        <net_io>
                <rate unit="kb/s">2637.8</rate>
                <rate unit="bps">21.6*10^6</rate>
        </net_io>
</cpu>

<errors total="0">
        <error type="client-timo">0</error>
        <error type="socket-timo">0</error>
        <error type="connrefused">0</error>
        <error type="connreset">0</error>
        <error type="fd-unavail">0</error>
        <error type="addrunavail">0</error>
        <error type="ftab-full">0</error>
        <error type="other">0</error>
</errors>
</results>

Although this is a little verbose, it does make it much easier to parse in
other programs.  I'm attaching the patch file for your consideration.

Comments? Questions? Concerns? Flames?

thanks
dave viner

------=_NextPart_000_0023_01C1D18F.064A84C0
Content-Type: application/octet-stream;
	name="httperf_output-xml.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="httperf_output-xml.patch"

diff -ruN httperf-0.8/httperf.c httperf-0.8-new/httperf.c=0A=
--- httperf-0.8/httperf.c	Tue Oct 31 12:20:00 2000=0A=
+++ httperf-0.8-new/httperf.c	Tue Mar 12 10:25:34 2002=0A=
@@ -76,6 +76,7 @@=0A=
 =0A=
 const char *prog_name;=0A=
 int verbose;=0A=
+int output_xml;=0A=
 Cmdline_Params param;=0A=
 Time test_time_start;=0A=
 Time test_time_stop;=0A=
@@ -136,6 +137,7 @@=0A=
     {"wsesslog",     required_argument, (int *) &param.wsesslog,	0},=0A=
     {"wsesspage",    required_argument, (int *) &param.wsesspage,	0},=0A=
     {"wset",	     required_argument, (int *) &param.wset,		0},=0A=
+    {"output-xml",   no_argument,	0,				'x'},=0A=
     {0,		     0,			0,				0}=0A=
   };=0A=
 =0A=
@@ -159,7 +161,8 @@=0A=
 	  "\t[--think-timeout X] [--timeout X] [--uri S] [--verbose] "=0A=
 	  "[--version]\n"=0A=
 	  "\t[--wlog y|n,file] [--wsess N,N,X] [--wsesslog N,X,file]\n"=0A=
-	  "\t[--wset N,X]\n",=0A=
+	  "\t[--wset N,X]\n"
+	  "\t[--output-xml]\n",=0A=
 	  prog_name);=0A=
 }=0A=
 =0A=
@@ -763,6 +766,10 @@=0A=
 		  " TIME_SYSCALLS.\n", prog_name);=0A=
 	  break;=0A=
 =0A=
+	case 'x':=0A=
+	  ++output_xml;=0A=
+	  break;=0A=
+=0A=
 	case 'h':=0A=
 	  usage ();=0A=
 	  exit (0);=0A=
@@ -929,7 +936,11 @@=0A=
 					param.wset.num_files,=0A=
 					param.wset.target_miss_rate);=0A=
     }=0A=
+  if(output_xml !=3D 0)=0A=
+	printf(" --output-xml");=0A=
+=0A=
   printf ("\n");=0A=
+  =0A=
 =0A=
   timer_init ();=0A=
   core_init ();=0A=
diff -ruN httperf-0.8/httperf.h httperf-0.8-new/httperf.h=0A=
--- httperf-0.8/httperf.h	Tue Oct 31 12:32:09 2000=0A=
+++ httperf-0.8-new/httperf.h	Thu Mar  7 18:59:47 2002=0A=
@@ -172,6 +172,7 @@=0A=
 =0A=
 extern const char *prog_name;=0A=
 extern int verbose;=0A=
+extern int output_xml;=0A=
 extern Cmdline_Params param;=0A=
 extern Time test_time_start;=0A=
 extern Time test_time_stop;=0A=
diff -ruN httperf-0.8/output.xml.txt httperf-0.8-new/output.xml.txt=0A=
--- httperf-0.8/output.xml.txt	Wed Dec 31 16:00:00 1969=0A=
+++ httperf-0.8-new/output.xml.txt	Tue Mar 12 10:27:13 2002=0A=
@@ -0,0 +1,66 @@=0A=
+httperf --client=3D0/1 --server=3Dlocalhost --port=3D80 --uri=3D/ =
--send-buffer=3D4096 --recv-buffer=3D16384 --num-conns=3D1 =
--num-calls=3D1 --output-xml=0A=
+Maximum connect burst length: 0=0A=
+<results>=0A=
+<totals>=0A=
+	<total type=3D"connections">1</total>=0A=
+	<total type=3D"requests">0</total>=0A=
+	<total type=3D"replies">0</total>=0A=
+	<total type=3D"test_duration">0.000</total>=0A=
+</totals>=0A=
+=0A=
+<connection concurrent_conns=3D"1">=0A=
+	<rate unit=3D"conns/sec">4829.4</rate>=0A=
+	<rate unit=3D"ms/conn">0.2</rate>=0A=
+	<time desc=3D"connection lifetime" unit=3D"ms" min=3D"0.0" avg=3D"0.0" =
max=3D"0.0" median=3D"0.0" stddev=3D"0.0" />=0A=
+	<time desc=3D"time to connect" unit=3D"ms">0.2</time>=0A=
+	<rate unit=3D"replies/conn">0.000</rate>=0A=
+</connection>=0A=
+=0A=
+<request>=0A=
+	<rate unit=3D"req/s">0.0</rate>=0A=
+	<rate unit=3D"ms/req">0.0</rate>=0A=
+	<size unit=3D"byte">0.0</size>=0A=
+</request>=0A=
+=0A=
+<reply unit=3D"replies/s" min=3D"0.0" avg=3D"0.0" max=3D"0.0" =
stddev=3D"0.0" samples=3D"0">=0A=
+	<times unit=3D"ms">=0A=
+		<time type=3D"response">0.0</time>=0A=
+		<time type=3D"transfer">0.0</time>=0A=
+	</times>=0A=
+	<sizes unit=3D"bytes">=0A=
+		<size type=3D"header">0.0</size>=0A=
+		<size type=3D"content">0.0</size>=0A=
+		<size type=3D"footer">0.0</size>=0A=
+		<size type=3D"total">0.0</size>=0A=
+	</sizes>=0A=
+	<status>=0A=
+		<stat unit=3D"1xx">0</stat>=0A=
+		<stat unit=3D"2xx">0</stat>=0A=
+		<stat unit=3D"3xx">0</stat>=0A=
+		<stat unit=3D"4xx">0</stat>=0A=
+		<stat unit=3D"5xx">0</stat>=0A=
+	</status>=0A=
+</reply>=0A=
+=0A=
+<cpu>=0A=
+	<time unit=3D"s" pct=3D"0.0%">=0A=
+		<user pct=3D"0.0%">0.00</user>=0A=
+		<system pct=3D"0.0%">0.00</system>=0A=
+	</time>=0A=
+	<net_io>=0A=
+		<rate unit=3D"kb/s">0.0</rate>=0A=
+		<rate unit=3D"bps">0.0*10^6</rate>=0A=
+	</net_io>=0A=
+</cpu>=0A=
+=0A=
+<errors total=3D"1">=0A=
+	<error type=3D"client-timo">0</error>=0A=
+	<error type=3D"socket-timo">0</error>=0A=
+	<error type=3D"connrefused">1</error>=0A=
+	<error type=3D"connreset">0</error>=0A=
+	<error type=3D"fd-unavail">0</error>=0A=
+	<error type=3D"addrunavail">0</error=0A=
+	<error type=3D"ftab-full">0</error>=0A=
+	<error type=3D"other">0</error>=0A=
+</errors>=0A=
+</results>=0A=
diff -ruN httperf-0.8/stat/basic.c httperf-0.8-new/stat/basic.c=0A=
--- httperf-0.8/stat/basic.c	Mon Oct 16 13:59:07 2000=0A=
+++ httperf-0.8-new/stat/basic.c	Thu Mar 14 14:37:01 2002=0A=
@@ -330,63 +330,121 @@=0A=
 	    printf ("%16.1f %u\n", 1e3*time, basic.conn_lifetime_hist[i]);=0A=
 	  }=0A=
     }=0A=
-=0A=
-  printf ("\nTotal: connections %u requests %u replies %u "=0A=
+
+  if(output_xml !=3D 0)
+	  printf("<results>\n");
+  if(output_xml !=3D 0)
+  {
+	  printf("<totals>\n"
+			 "\t<total type=3D\"connections\">%u</total>\n"
+			 "\t<total type=3D\"requests\">%u</total>\n"
+			 "\t<total type=3D\"replies\">%u</total>\n"
+			 "\t<total type=3D\"test_duration\">%.3f</total>\n"
+			 "</totals>\n",
+			basic.num_conns_issued, basic.num_sent, total_replies, delta);
+  } else {=0A=
+	printf ("\nTotal: connections %u requests %u replies %u "=0A=
 	  "test-duration %.3f s\n",=0A=
 	  basic.num_conns_issued, basic.num_sent, total_replies,=0A=
 	  delta);=0A=
+  }
 =0A=
   putchar ('\n');=0A=
 =0A=
   if (basic.num_conns_issued)=0A=
-    conn_period =3D delta/basic.num_conns_issued;=0A=
-  printf ("Connection rate: %.1f conn/s (%.1f ms/conn, "=0A=
+    conn_period =3D delta/basic.num_conns_issued;
+
+  /*
+   *  CONNECTION INFORMATION
+   */
+   if (basic.num_lifetimes > 0)
+    {
+      lifetime_avg =3D (basic.conn_lifetime_sum / basic.num_lifetimes);
+      if (basic.num_lifetimes > 1)
+	lifetime_stddev =3D STDDEV (basic.conn_lifetime_sum,
+				  basic.conn_lifetime_sum2,
+				  basic.num_lifetimes);
+      n =3D 0;
+      for (i =3D 0; i < NUM_BINS; ++i)
+	{
+	  n +=3D basic.conn_lifetime_hist[i];
+	  if (n >=3D 0.5*basic.num_lifetimes)
+	    {
+	      lifetime_median =3D (i + 0.5)*BIN_WIDTH;
+	      break;
+	    }
+	}
+  } =20
+  if (basic.num_connects > 0)
+    conn_time =3D basic.conn_connect_sum / basic.num_connects;
+
+  if(output_xml !=3D 0)
+  {
+	  printf("<connection concurrent_conns=3D\"%u\">\n"
+		     "\t<rate unit=3D\"conns/sec\">%.1f</rate>\n"
+		     "\t<rate unit=3D\"ms/conn\">%.1f</rate>\n"
+			 "\t<time desc=3D\"connection lifetime\" unit=3D\"ms\" =
min=3D\"%.1f\" avg=3D\"%.1f\" max=3D\"%.1f\" median=3D\"%.1f\" =
stddev=3D\"%.1f\" />\n"
+			 "\t<time desc=3D\"time to connect\" unit=3D\"ms\">%.1f</time>\n"
+			 "\t<rate unit=3D\"replies/conn\">%.3f</rate>\n"
+			 "</connection>\n",
+			 basic.max_conns, basic.num_conns_issued/delta,1e3*conn_period,
+			 basic.num_lifetimes > 0 ? 1e3 * basic.conn_lifetime_min : 0.0,
+			 1e3 * lifetime_avg,
+			 1e3 * basic.conn_lifetime_max, 1e3 * lifetime_median,
+			 1e3 * lifetime_stddev,
+			 1e3*conn_time,
+			 basic.num_lifetimes > 0
+				? total_replies/ (double) basic.num_lifetimes : 0.0
+			 );
+
+  } else {=0A=
+	printf ("Connection rate: %.1f conn/s (%.1f ms/conn, "=0A=
 	  "<=3D%u concurrent connections)\n",=0A=
 	  basic.num_conns_issued / delta, 1e3*conn_period, basic.max_conns);=0A=
-=0A=
-  if (basic.num_lifetimes > 0)=0A=
-    {=0A=
-      lifetime_avg =3D (basic.conn_lifetime_sum / basic.num_lifetimes);=0A=
-      if (basic.num_lifetimes > 1)=0A=
-	lifetime_stddev =3D STDDEV (basic.conn_lifetime_sum,=0A=
-				  basic.conn_lifetime_sum2,=0A=
-				  basic.num_lifetimes);=0A=
-      n =3D 0;=0A=
-      for (i =3D 0; i < NUM_BINS; ++i)=0A=
-	{=0A=
-	  n +=3D basic.conn_lifetime_hist[i];=0A=
-	  if (n >=3D 0.5*basic.num_lifetimes)=0A=
-	    {=0A=
-	      lifetime_median =3D (i + 0.5)*BIN_WIDTH;=0A=
-	      break;=0A=
-	    }=0A=
-	}=0A=
-    }  =0A=
-  printf ("Connection time [ms]: min %.1f avg %.1f max %.1f median %.1f =
"=0A=
+	printf ("Connection time [ms]: min %.1f avg %.1f max %.1f median %.1f "=0A=
 	  "stddev %.1f\n",=0A=
 	  basic.num_lifetimes > 0 ? 1e3 * basic.conn_lifetime_min : 0.0,=0A=
 	  1e3 * lifetime_avg,=0A=
 	  1e3 * basic.conn_lifetime_max, 1e3 * lifetime_median,=0A=
 	  1e3 * lifetime_stddev);=0A=
-  if (basic.num_connects > 0)=0A=
-    conn_time =3D basic.conn_connect_sum / basic.num_connects;=0A=
-  printf ("Connection time [ms]: connect %.1f\n", 1e3*conn_time);=0A=
-  printf ("Connection length [replies/conn]: %.3f\n",=0A=
+=0A=
+	printf ("Connection time [ms]: connect %.1f\n", 1e3*conn_time);=0A=
+	printf ("Connection length [replies/conn]: %.3f\n",=0A=
 	  basic.num_lifetimes > 0=0A=
-	  ? total_replies/ (double) basic.num_lifetimes : 0.0);=0A=
+	  ? total_replies/ (double) basic.num_lifetimes : 0.0);
+  }=0A=
   putchar ('\n');=0A=
-=0A=
+
+  /*
+   *  REQUEST INFORMATION
+   */=0A=
   if (basic.num_sent > 0)=0A=
-    call_period =3D delta/basic.num_sent;=0A=
-  printf ("Request rate: %.1f req/s (%.1f ms/req)\n",=0A=
-	  basic.num_sent / delta, 1e3*call_period);=0A=
-=0A=
-  if (basic.num_sent)=0A=
-    call_size =3D basic.req_bytes_sent / basic.num_sent;=0A=
-  printf ("Request size [B]: %.1f\n", call_size);=0A=
+    call_period =3D delta/basic.num_sent;
+  if (basic.num_sent)
+    call_size =3D basic.req_bytes_sent / basic.num_sent;
+=0A=
+  if(output_xml !=3D 0)
+  {
+	printf ("<request>\n"
+			"\t<rate unit=3D\"req/s\">%.1f</rate>\n"
+			"\t<rate unit=3D\"ms/req\">%.1f</rate>\n"
+			"\t<size unit=3D\"byte\">%.1f</size>\n"
+			"</request>\n",=0A=
+			basic.num_sent / delta, 1e3*call_period, call_size);
+	=0A=
+  } else {
+	  printf ("Request rate: %.1f req/s (%.1f ms/req)\n",
+		  basic.num_sent / delta, 1e3*call_period);
+	  printf ("Request size [B]: %.1f\n", call_size);
+  }=0A=
+  =0A=
+  =0A=
 =0A=
   putchar ('\n');=0A=
-=0A=
+
+  /*
+   *  REPLY INFORMATION
+   */=0A=
   if (basic.num_reply_rates > 0)=0A=
     {=0A=
       reply_rate_avg =3D (basic.reply_rate_sum / basic.num_reply_rates);=0A=
@@ -394,54 +452,140 @@=0A=
 	reply_rate_stddev =3D STDDEV (basic.reply_rate_sum,=0A=
 				    basic.reply_rate_sum2,=0A=
 				    basic.num_reply_rates);=0A=
-    }=0A=
-  printf ("Reply rate [replies/s]: min %.1f avg %.1f max %.1f stddev =
%.1f "=0A=
-	  "(%u samples)\n",=0A=
-	  basic.num_reply_rates > 0 ? basic.reply_rate_min : 0.0,=0A=
-	  reply_rate_avg, basic.reply_rate_max,=0A=
-	  reply_rate_stddev, basic.num_reply_rates);=0A=
-=0A=
-  if (basic.num_responses > 0)=0A=
-    resp_time =3D basic.call_response_sum / basic.num_responses;=0A=
-  if (total_replies > 0)=0A=
-    xfer_time =3D basic.call_xfer_sum / total_replies;=0A=
-  printf ("Reply time [ms]: response %.1f transfer %.1f\n",=0A=
-	  1e3*resp_time, 1e3*xfer_time);=0A=
-=0A=
-  if (total_replies)=0A=
-    {=0A=
-      hdr_size =3D basic.hdr_bytes_received / total_replies;=0A=
-      reply_size =3D basic.reply_bytes_received / total_replies;=0A=
-      footer_size =3D basic.footer_bytes_received / total_replies;=0A=
-    }=0A=
-  printf ("Reply size [B]: header %.1f content %.1f footer %.1f "=0A=
-	  "(total %.1f)\n", hdr_size, reply_size, footer_size,=0A=
-	  hdr_size + reply_size + footer_size);=0A=
-=0A=
-  printf ("Reply status: 1xx=3D%u 2xx=3D%u 3xx=3D%u 4xx=3D%u =
5xx=3D%u\n",=0A=
-	  basic.num_replies[1], basic.num_replies[2], basic.num_replies[3],=0A=
-	  basic.num_replies[4], basic.num_replies[5]);=0A=
+    }
+  if (basic.num_responses > 0)
+    resp_time =3D basic.call_response_sum / basic.num_responses;
+  if (total_replies > 0)
+    xfer_time =3D basic.call_xfer_sum / total_replies;
+
+  if (total_replies)
+    {
+      hdr_size =3D basic.hdr_bytes_received / total_replies;
+      reply_size =3D basic.reply_bytes_received / total_replies;
+      footer_size =3D basic.footer_bytes_received / total_replies;
+    }
+
+  if(output_xml !=3D 0 )
+  {
+	  printf ("<reply unit=3D\"replies/s\" min=3D\"%.1f\" avg=3D\"%.1f\" =
max=3D\"%.1f\" stddev=3D\"%.1f\""
+			  " samples=3D\"%u\">\n"
+			  "\t<times unit=3D\"ms\">\n"
+			  "\t\t<time type=3D\"response\">%.1f</time>\n"
+			  "\t\t<time type=3D\"transfer\">%.1f</time>\n"
+			  "\t</times>\n"
+			  "\t<sizes unit=3D\"bytes\">\n"
+			  "\t\t<size type=3D\"header\">%.1f</size>\n"
+			  "\t\t<size type=3D\"content\">%.1f</size>\n"
+			  "\t\t<size type=3D\"footer\">%.1f</size>\n"
+			  "\t\t<size type=3D\"total\">%.1f</size>\n"
+			  "\t</sizes>\n"
+			  "\t<status>\n"
+			  "\t\t<stat unit=3D\"1xx\">%u</stat>\n"
+			  "\t\t<stat unit=3D\"2xx\">%u</stat>\n"
+			  "\t\t<stat unit=3D\"3xx\">%u</stat>\n"
+			  "\t\t<stat unit=3D\"4xx\">%u</stat>\n"
+			  "\t\t<stat unit=3D\"5xx\">%u</stat>\n"
+			  "\t</status>\n"
+			  "</reply>\n",
+		basic.num_reply_rates > 0 ? basic.reply_rate_min : 0.0,
+		reply_rate_avg, basic.reply_rate_max,
+		reply_rate_stddev, basic.num_reply_rates,
+		1e3*resp_time, 1e3*xfer_time,
+		hdr_size, reply_size, footer_size,
+		hdr_size + reply_size + footer_size,
+		basic.num_replies[1], basic.num_replies[2], basic.num_replies[3],
+			basic.num_replies[4], basic.num_replies[5]
+		);
+
+  } else {=0A=
+	printf ("Reply rate [replies/s]: min %.1f avg %.1f max %.1f stddev =
%.1f "=0A=
+		  "(%u samples)\n",=0A=
+		basic.num_reply_rates > 0 ? basic.reply_rate_min : 0.0,=0A=
+		reply_rate_avg, basic.reply_rate_max,=0A=
+		reply_rate_stddev, basic.num_reply_rates);=0A=
+=0A=
+	  printf ("Reply time [ms]: response %.1f transfer %.1f\n",=0A=
+		  1e3*resp_time, 1e3*xfer_time);=0A=
+=0A=
+=0A=
+	  printf ("Reply size [B]: header %.1f content %.1f footer %.1f "=0A=
+		  "(total %.1f)\n", hdr_size, reply_size, footer_size,=0A=
+		hdr_size + reply_size + footer_size);=0A=
+=0A=
+	 printf ("Reply status: 1xx=3D%u 2xx=3D%u 3xx=3D%u 4xx=3D%u =
5xx=3D%u\n",=0A=
+		  basic.num_replies[1], basic.num_replies[2], basic.num_replies[3],=0A=
+			basic.num_replies[4], basic.num_replies[5]);
+	 }=0A=
 =0A=
   putchar ('\n');=0A=
-=0A=
+
+  /*
+   *  CPU INFORMATION
+   */=0A=
   user =3D (TV_TO_SEC (test_rusage_stop.ru_utime)=0A=
 	  - TV_TO_SEC (test_rusage_start.ru_utime));=0A=
   sys =3D (TV_TO_SEC (test_rusage_stop.ru_stime)=0A=
 	  - TV_TO_SEC (test_rusage_start.ru_stime));=0A=
-  printf ("CPU time [s]: user %.2f system %.2f (user %.1f%% system =
%.1f%% "=0A=
-	  "total %.1f%%)\n", user, sys, 100.0*user/delta, 100.0*sys/delta,=0A=
-	  100.0*(user + sys)/delta);=0A=
+  =0A=
 =0A=
   total_size =3D (basic.req_bytes_sent=0A=
-		+ basic.hdr_bytes_received + basic.reply_bytes_received);=0A=
-  printf ("Net I/O: %.1f KB/s (%.1f*10^6 bps)\n",=0A=
-	  total_size/delta / 1024.0, 8e-6*total_size/delta);=0A=
+		+ basic.hdr_bytes_received + basic.reply_bytes_received);
+
+  if(output_xml !=3D 0)
+  {
+	  printf ("<cpu>\n"
+			  "\t<time unit=3D\"s\" pct=3D\"%.1f%%\">\n"
+			  "\t\t<user pct=3D\"%.1f%%\">%.2f</user>\n"
+			  "\t\t<system pct=3D\"%.1f%%\">%.2f</system>\n"
+			  "\t</time>\n"
+			  "\t<net_io>\n"
+			  "\t\t<rate unit=3D\"kb/s\">%.1f</rate>\n"
+			  "\t\t<rate unit=3D\"bps\">%.1f*10^6</rate>\n"
+			  "\t</net_io>\n"
+			  "</cpu>\n",
+				100.0*(user + sys)/delta,
+				100.0*user/delta, user,=20
+				100.0*sys/delta,sys, =20
+				total_size/delta / 1024.0, 8e-6*total_size/delta);
+
+  } else {
+	printf ("CPU time [s]: user %.2f system %.2f (user %.1f%% system =
%.1f%% "
+		  "total %.1f%%)\n", user, sys, 100.0*user/delta, 100.0*sys/delta,
+		100.0*(user + sys)/delta);=0A=
+	 printf ("Net I/O: %.1f KB/s (%.1f*10^6 bps)\n",=0A=
+		  total_size/delta / 1024.0, 8e-6*total_size/delta);
+  }=0A=
 =0A=
   putchar ('\n');=0A=
-=0A=
-  printf ("Errors: total %u client-timo %u socket-timo %u "=0A=
-	  "connrefused %u connreset %u\n"=0A=
-	  "Errors: fd-unavail %u addrunavail %u ftab-full %u other %u\n",=0A=
+
+  /*
+   *  ERRORS INFORMATION
+   */
+  if(output_xml !=3D 0)
+  {
+	  printf ("<errors total=3D\"%u\">\n"
+			  "\t<error type=3D\"client-timo\">%u</error>\n"
+			  "\t<error type=3D\"socket-timo\">%u</error>\n"
+			  "\t<error type=3D\"connrefused\">%u</error>\n"
+			  "\t<error type=3D\"connreset\">%u</error>\n"
+			  "\t<error type=3D\"fd-unavail\">%u</error>\n"
+			  "\t<error type=3D\"addrunavail\">%u</error>\n"
+			  "\t<error type=3D\"ftab-full\">%u</error>\n"
+			  "\t<error type=3D\"other\">%u</error>\n"
+			  "</errors>\n",
+	  (basic.num_client_timeouts + basic.num_sock_timeouts
+	   + basic.num_sock_fdunavail + basic.num_sock_ftabfull
+	   + basic.num_sock_refused + basic.num_sock_reset
+	   + basic.num_sock_addrunavail + basic.num_other_errors),
+	  basic.num_client_timeouts, basic.num_sock_timeouts,
+	  basic.num_sock_refused, basic.num_sock_reset,
+	  basic.num_sock_fdunavail, basic.num_sock_addrunavail,
+	  basic.num_sock_ftabfull, basic.num_other_errors);
+
+  } else {=0A=
+	printf ("Errors: total %u client-timo %u socket-timo %u "=0A=
+		  "connrefused %u connreset %u\n"=0A=
+		"Errors: fd-unavail %u addrunavail %u ftab-full %u other %u\n",=0A=
 	  (basic.num_client_timeouts + basic.num_sock_timeouts=0A=
 	   + basic.num_sock_fdunavail + basic.num_sock_ftabfull=0A=
 	   + basic.num_sock_refused + basic.num_sock_reset=0A=
@@ -449,7 +593,11 @@=0A=
 	  basic.num_client_timeouts, basic.num_sock_timeouts,=0A=
 	  basic.num_sock_refused, basic.num_sock_reset,=0A=
 	  basic.num_sock_fdunavail, basic.num_sock_addrunavail,=0A=
-	  basic.num_sock_ftabfull, basic.num_other_errors);=0A=
+	  basic.num_sock_ftabfull, basic.num_other_errors);
+  }
+
+  if(output_xml !=3D 0)
+	  printf("</results>\n");=0A=
 }=0A=
 =0A=
 Stat_Collector stats_basic =3D=0A=

------=_NextPart_000_0023_01C1D18F.064A84C0--