Package: binkd
Version: 0.9.9+20060809-1
Severity: minor
Tags: patch

 Binkdlogstat generate wrong statistic when binkd log contain large
transferted sizes.
Example:

 Addr           In    In   Out    Out    Bytes     Bytes Files Files   Avg
                OK   Fail   OK   Fail     sent      recv  sent  recv   CPS
=============================================================================

2:50/13           8     0     0     0         0     15191     0     2
7595.50
2:4635/69      4843     3     0   171   5107042   2032808  1445  1109
2090.12
2:5050/144.1   5696     0     0     0 -1642925445 905881933 10909   954
272512.54
2:5050/144.6    196     1     0     0   2125219      6855    72    17
12615.82
2:5050/144.37   234     3     0     0   4564598     28719   163    41
11121.83
=============================================================================

 Total       10977     7     0   171 -1631128586 907965506 12589  2123
209416.27

 I think transferted sizes would show in Kbytes, because it grows in last
years heavy. Atached patch make this change and fix bug.

--
Pavel 'Blaze' Vinogradov
Beginner Linux Developer
--- binkdlogstat.orig   2006-08-25 22:21:00.000000000 +0400
+++ binkdlogstat        2007-03-18 22:21:52.000000000 +0300
@@ -1,7 +1,11 @@
 #!/usr/bin/perl
 
 # binkd log analizer     ver 0.1   11 Jan 1999
-# Copyright (c) Pavel Gulchouck <[EMAIL PROTECTED]>  2:463/68
+#                       ver 0.2   15 May 2007
+#      * Sent and recv sizes now counts in KBytes
+#
+# Copyright 1999-2007 (c) Pavel Gulchouck <[EMAIL PROTECTED]>  2:463/68
+# Copyright 2007 (c) Pavel Vinogradov <[EMAIL PROTECTED]>  2:5050/144
 # License: BSD.
 
 while (<>) {
@@ -59,8 +63,8 @@
 }
 
 print <<EOF;
-  Addr           In    In   Out    Out    Bytes     Bytes Files Files   Avg
-                 OK   Fail   OK   Fail     sent      recv  sent  recv   CPS
+  Addr           In    In   Out    Out    KBytes    KBytes Files Files   Avg
+                 OK   Fail   OK   Fail      sent      recv  sent  recv   CPS
 =============================================================================
 EOF
 
@@ -70,7 +74,7 @@
        printf $format,
          $addr, $okin{$addr}, $failedin{$addr},
          $okout{$addr}, $failedout{$addr},
-         $sentbytes{$addr}, $rcvbytes{$addr},
+         $sentbytes{$addr}/1024, $rcvbytes{$addr}/1024,
          $sentfiles{$addr}, $rcvfiles{$addr},
          $time{$addr} ? ($sentbytes{$addr}+$rcvbytes{$addr})/$time{$addr} : 0;
        $totokin += $okin{$addr};
@@ -88,7 +92,7 @@
 EOF
 printf $format,
   "  Total", $totokin, $totfailedin, $totokout, $totfailedout,
-  $totsentbytes, $totrcvbytes, $totsentfiles, $totrcvfiles,
+  $totsentbytes/1024, $totrcvbytes/1024, $totsentfiles, $totrcvfiles,
   $tottime ? ($totsentbytes+$totrcvbytes)/$tottime : 0;
 
 sub cmpaddr {

Reply via email to