mldonkey-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-users] Re: stats


From: Sven Hartge
Subject: [Mldonkey-users] Re: stats
Date: Sun, 01 Dec 2002 20:20:29 +0100
User-agent: tin/1.5.14-20020926 ("Soil") (UNIX) (Linux/2.4.20-112 (i586))

Sven Hartge <address@hidden> wrote:
> Roland Arendes <address@hidden> wrote:
 
>> The current stats are looking good for "mldonkey pango":
>> Total filerequests received: 330567
 
> How about a section "Total filerequest sent"?

While I am at it, I cleaned the stats somewhat, making them a bit more
readable (in my optinion). This is a very simple patch, since I don't
know a single line of Ocaml.

Apply with -p1 while being in your mldonkey source dir.

diff -ur mldonkey-src.old/donkey/donkeyStats.ml 
mldonkey-src/donkey/donkeyStats.ml
--- mldonkey-src.old/donkey/donkeyStats.ml      2002-12-01 19:05:50.000000000 
+0100
+++ mldonkey-src/donkey/donkeyStats.ml  2002-12-01 20:14:38.000000000 +0100
@@ -121,9 +121,9 @@
   if stats_all.brand_seen = 0 then
     Printf.bprintf buf "You didn't see any client yet\n"
   else begin
-    Printf.bprintf buf "Total seens: %d\n" stats_all.brand_seen;
+    Printf.bprintf buf "                Total seens: %18d\n" 
stats_all.brand_seen;
     for i=1 to brand_count-1 do
-      Printf.bprintf buf "%22s: %d (%.2f %%)\n" 
+      Printf.bprintf buf "%27s: %18d (%3.2f %%)\n" 
        (brand_to_string (brand_of_int i)) 
        stats_by_brand.(i).brand_seen 
        (100. *. (float_of_int stats_by_brand.(i).brand_seen) /. (float_of_int 
stats_all.brand_seen))
@@ -133,10 +133,10 @@
   if stats_all.brand_filerequest = 0 then
     Printf.bprintf buf "You weren't asked for any file yet\n"
   else begin
-    Printf.bprintf buf "Total filerequests received: %d\n" 
stats_all.brand_filerequest;
+    Printf.bprintf buf "Total filerequests received: %18d\n" 
stats_all.brand_filerequest;
     for i=1 to brand_count-1 do
-      Printf.bprintf buf "%22s: %d (%.2f %%)\n" 
-       ("From " ^ (brand_to_string (brand_of_int i))) 
+      Printf.bprintf buf "%27s: %18d (%3.2f %%)\n" 
+       (brand_to_string (brand_of_int i))
        stats_by_brand.(i).brand_filerequest 
        (100. *. (float_of_int stats_by_brand.(i).brand_filerequest) /. 
(float_of_int stats_all.brand_filerequest))
     done
@@ -145,10 +145,10 @@
   if stats_all.brand_download = Int64.zero then
     Printf.bprintf buf "You didn't download anything yet\n"
   else begin
-    Printf.bprintf buf "Total downloads: %s\n" (Int64.to_string 
stats_all.brand_download);
+    Printf.bprintf buf "            Total downloads: %18s\n" (Int64.to_string 
stats_all.brand_download);
     for i=1 to brand_count-1 do
-      Printf.bprintf buf "%22s: %s (%.2f %%)\n" 
-       ("From " ^ (brand_to_string (brand_of_int i))) 
+      Printf.bprintf buf "%27s: %18s (%3.2f %%)\n" 
+       (brand_to_string (brand_of_int i))
        (Int64.to_string stats_by_brand.(i).brand_download) 
        (100. *. (Int64.to_float stats_by_brand.(i).brand_download) /. 
(Int64.to_float stats_all.brand_download))
     done
@@ -157,10 +157,10 @@
   if stats_all.brand_upload = Int64.zero then
     Printf.bprintf buf "You didn't upload anything yet\n"
   else begin
-    Printf.bprintf buf "Total uploads: %s\n" (Int64.to_string 
stats_all.brand_upload);
+    Printf.bprintf buf "              Total uploads: %18s\n" (Int64.to_string 
stats_all.brand_upload);
     for i=1 to brand_count-1 do
-      Printf.bprintf buf "%22s: %s (%.2f %%)\n" 
-       ("To " ^ (brand_to_string (brand_of_int i))) 
+      Printf.bprintf buf "%27s: %18s (%3.2f %%)\n" 
+       (brand_to_string (brand_of_int i))
        (Int64.to_string stats_by_brand.(i).brand_upload) 
        (100. *. (Int64.to_float stats_by_brand.(i).brand_upload) /. 
(Int64.to_float stats_all.brand_upload))
     done


-- 
BOFH excuse #131:

telnet: Unable to connect to remote host: Connection refused




reply via email to

[Prev in Thread] Current Thread [Next in Thread]