• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

6. Performance Analysis > Hits per Second

Hits per Second

Here is a little Perl script you can run against your log file to generate a hits per second distribution over the day. You can download it from http://patrick.net/software/hps.pl. Be aware that response times get recorded when the response finishes, not when it starts, so the hits per second you see are responses completed in that second, not how many simultaneous requests you received.

#!/usr/local/bin/perl

$\ = "\n";

while(<>) {
    /(:\d\d:\d\d:\d\d)/;  # hour min second
    #/(:\d\d:\d\d):\d\d/; # or use this match for hits per minute

    $key = $1;

    $key =~ s/:/ /g;      # remove ":" so gnuplot can digest output

    $bucket{$key}++;      # add a hit to the bucket for that second
}

foreach $key (sort keys %bucket) {
    print $key, " ", $bucket{$key};
}

PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint