Rev-FQDN patch suggestion for access-summary.pl

From: <Ted_Rule@dont-contact.us>
Date: Thu, 1 Jul 1999 15:02:18 +0100

I've patched my local copy of the access-summary.pl script to reverse the
display of the client FQDN's. It seemed strange to me that the Client Summary
tables gave the client name in reverse FQDN order, i.e:

     client name == pc.at.my.net.work.com

showed up in the stats pages as:

     client name == com.work.net.my.at.pc

and so on.

Additionally, the Client Utilization Table truncated the client name at 23
characters, even though
much more space generally existed on screen. I've upped this to 40 characters
truncation limit,
but no doubt others will be able to correct my poorly HTML fix and work how to
allow an "unlimited"
width. The diff for the change is as below.

These are relative to an elderly cache-state-1.4.tar.gz source tree. A quick
scan of the Squid site
suggests these "problems" still exist in the current version.

Any comments folks?

Ted Rule,
Flextech Television

# diff -u access-summary.pl.orig access-summary.pl.patched
--- access-summary.pl.orig Thu Jul 1 14:03:22 1999
+++ access-summary.pl.patched Thu Jul 1 14:03:22 1999
@@ -135,7 +135,7 @@
        &table_table('Protocol', 'SUMMARY OF PROTOCOL USAGE', \%PR,
                \&xsort,undef,undef,0,0,0);
        &table_table('Client', 'SUMMARY OF CLIENT USAGE', \%CL,
- \&clsort,\&rev_fqdn,$TopN,0,0,0);
+ \&clsort,\&fqdn,$TopN,0,0,0);
        &table_table('Server', 'SUMMARY OF SERVER USAGE', \%SE,
                \&xsort,\&rev_server,$TopN,0,0,0);
        &table_table('Type', 'SUMMARY OF URL TYPES', \%TY,
@@ -144,7 +144,7 @@
                \&xsort,\&top_domain_name,undef,0,0,0);

        &utilization_table('Client', 'CLIENT UTILIZATION', \%CL,
- undef,\&rev_fqdn,undef);
+ undef,\&fqdn,undef);

        &list_top('URL', "TOP $TopN HTTP Requests", \%UR,
                \&aksort, undef, $TopN, 'ALLTCP');
@@ -204,7 +204,7 @@
        print "<a href=\"#00\">Goto Top</a>\n";
        print "<p>\n<hr>\n<p>\n";
        &table_table('Client', '3. Summary of Client Usage', \%CL,
- \&clsort,\&rev_fqdn,$TopN,0,0,0);
+ \&clsort,\&fqdn,$TopN,0,0,0);
        print "<a name=\"04\">\n";
        print "<a href=\"#00\">Goto Top</a>\n";
        print "<p>\n<hr>\n<p>\n";
@@ -224,7 +224,7 @@
        print "<a href=\"#00\">Goto Top</a>\n";
        print "<p>\n<hr>\n<p>\n";
        &utilization_table('Client', '7. Client Utilization', \%CL,
- undef,\&rev_fqdn,undef);
+ undef,\&fqdn,undef);
        print "<a name=\"08\">\n";
        print "<a href=\"#00\">Goto Top</a>\n";
        print "<p>\n<hr>\n<p>\n";
@@ -503,12 +503,12 @@
                $TR = "<tr>";
        } else {
                print "\n", &center($title), "\n\n";
- printf "%-23.23s %7s + %14s = %s\n",
+ printf "%-40.40s %7s + %14s = %s\n",
                        'Client',
                        'Hitrate',
                        'HTTP:ICP Ratio',
                        'Utilization';
- printf "%-23.23s %7s %14s %s\n", '-'x23,'-'x6,'-'x14,'-'x11;
+ printf "%-40.40s %7s %14s %s\n", '-'x40,'-'x6,'-'x14,'-'x11;
        }

        @CLIENTS = keys %{$hash};
@@ -519,7 +519,7 @@
                $RATIO{$C} = $ratio;
        }
        foreach $C (sort {$UTIL{$b} <=> $UTIL{$a}} @CLIENTS) {
- printf "$TR\n$TDL%-23.23s $TDR%7.2f + $TDR%14.2f = $TDR%11.2f\n"
,
+ printf "$TR\n$TDL%-40.40s $TDR%7.2f + $TDR%14.2f = $TDR%11.2f\n"
,
                        &{$keyprint}($C),
                        $HITRATE{$C},
                        $RATIO{$C},

*****************************************************************
This E-mail message, (including any attachments), is intended
only for the person or entity to which it is addressed,
and may contain confidential information.

If you are not the intended recipient, any review, retransmission,
disclosure, copying, modification or other use of this E-mail message
or attachments is strictly forbidden.

If you have received this E-mail message in error, please contact the
author and delete the message and any attachments from your computer.

You are also advised that the views and opinions expressed in this E-mail
message and any attachments are the author's own, and may not reflect the
views and opinions of FLEXTECH Television.
*****************************************************************
Received on Thu Jul 01 1999 - 07:59:37 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:47:16 MST