<?xml version="1.0" encoding="UTF-8"?>
<snippet>
  <account-id type="integer">2</account-id>
  <body>The best thing about this script is that it's easy to customize, right now it's optimized for comma delimited data. 

&lt;code&gt;
use strict;
use warnings;

# Import stdev, average, mean and other statistical functions
# A copy of http://search.cpan.org/~brianl/Statistics-Lite-3.2/Lite.pm
do('stats.pl');

my %page_runtimes;
my $delimitor = ';';
my @columns = (&quot;page&quot;, &quot;samples&quot;, &quot;min&quot;, &quot;max&quot;, &quot;mean&quot;, &quot;mode&quot;, &quot;median&quot;, &quot;stddev\n&quot;);
my $line;
my $first_timestamp, my $last_timestamp;

# ==========================================
# Parse log file
# ==========================================

#
# Don't use foreach as it reads the whole file into memory: foreach $line (&lt;&gt;) { 
#
while ($line=&lt;&gt;) {
  # remove the newline from $line, otherwise the report will be corrupted.
  chomp($line);

  my @columns               = split(';', $line);
  my $timestamp             = $columns[0];
  my $page_name             = $columns[1];
  my $page_runtime          = $columns[2];

  if(!defined($first_timestamp))
  {
    $first_timestamp = $timestamp;
  }

  # print what we find
  if(!defined(@{$page_runtimes{$page_name}}))
  {
    print &quot;Found page '$page_name'\n&quot;;
  }
 
  # add page runtimes to one hash
  push(@{$page_runtimes{$page_name}}, $page_runtime);
 
  $last_timestamp = $timestamp;
}

# ==========================================
# Calculate and print page statistics
# ==========================================
open(PAGE_REPORT, &quot;&gt;report.csv&quot;) or die(&quot;Could not open report.csv.&quot;);

print PAGE_REPORT &quot;First sample\n&quot;.$first_timestamp.&quot;\nLast sample\n&quot;.$last_timestamp.&quot;\n\n&quot;;
print PAGE_REPORT join($delimitor, @columns);

for my $page_name (keys %page_runtimes )
{
  my @runtimes = @{$page_runtimes{$page_name}};
 
  my $samples = @runtimes;
  my $min     = min(@runtimes);
  my $max     = max(@runtimes);
  my $mean    = mean(@runtimes);
  my $mode    = mode(@runtimes);
  my $median  = median(@runtimes);
  my $stddev  = stddev(@runtimes);
 
  my @data = ($page_name, $samples, $min, $max, $mean, $mode, $median, $stddev);
 
  my $line = join($delimitor, @data);
 
  # Use comma instead of decimal
  $line =~ s/\./\,/g;
 
  print PAGE_REPORT &quot;$line\n&quot;;
}
close(PAGE_REPORT);
&lt;/code&gt;


To use it simply pipe some data into it like this:

&lt;code&gt;
grep &quot;2008-31-12&quot; silly-data.log | perl analyze.pl
&lt;/code&gt;
</body>
  <comments-count type="integer">0</comments-count>
  <created-at type="datetime">2008-09-02T16:52:09+03:00</created-at>
  <id type="integer">239</id>
  <language-id type="integer">101</language-id>
  <rendered-body>&lt;p&gt;The best thing about this script is that it&amp;#8217;s easy to customize, right now it&amp;#8217;s optimized for comma delimited data.&lt;/p&gt;
&lt;p&gt;&lt;pre class=&quot;active4d&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;use&lt;/span&gt; strict;
&lt;span class=&quot;line-numbers&quot;&gt;   2 &lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;use&lt;/span&gt; warnings;
&lt;span class=&quot;line-numbers&quot;&gt;   3 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   4 &lt;/span&gt; &lt;span class=&quot;LineComment&quot;&gt;&lt;span class=&quot;LineComment&quot;&gt;#&lt;/span&gt; Import stdev, average, mean and other statistical functions&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   5 &lt;/span&gt; &lt;span class=&quot;LineComment&quot;&gt;&lt;span class=&quot;LineComment&quot;&gt;#&lt;/span&gt; A copy of http://search.cpan.org/~brianl/Statistics-Lite-3.2/Lite.pm&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;   6 &lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;do&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;stats.pl&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;   7 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;   8 &lt;/span&gt; &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;%&lt;/span&gt;page_runtimes&lt;/span&gt;;
&lt;span class=&quot;line-numbers&quot;&gt;   9 &lt;/span&gt; &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;delimitor&lt;/span&gt; = &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;;
&lt;span class=&quot;line-numbers&quot;&gt;  10 &lt;/span&gt; &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;columns&lt;/span&gt; = (&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;page&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;samples&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;min&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;max&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;mean&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;mode&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;median&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;stddev&lt;span class=&quot;UserDefinedConstant&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;  11 &lt;/span&gt; &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;line&lt;/span&gt;;
&lt;span class=&quot;line-numbers&quot;&gt;  12 &lt;/span&gt; &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;first_timestamp&lt;/span&gt;, &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;last_timestamp&lt;/span&gt;;
&lt;span class=&quot;line-numbers&quot;&gt;  13 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  14 &lt;/span&gt; &lt;span class=&quot;LineComment&quot;&gt;&lt;span class=&quot;LineComment&quot;&gt;#&lt;/span&gt; ==========================================&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  15 &lt;/span&gt; &lt;span class=&quot;LineComment&quot;&gt;&lt;span class=&quot;LineComment&quot;&gt;#&lt;/span&gt; Parse log file&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  16 &lt;/span&gt; &lt;span class=&quot;LineComment&quot;&gt;&lt;span class=&quot;LineComment&quot;&gt;#&lt;/span&gt; ==========================================&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  17 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  18 &lt;/span&gt; &lt;span class=&quot;LineComment&quot;&gt;&lt;span class=&quot;LineComment&quot;&gt;#&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  19 &lt;/span&gt; &lt;span class=&quot;LineComment&quot;&gt;&lt;span class=&quot;LineComment&quot;&gt;#&lt;/span&gt; Don't use foreach as it reads the whole file into memory: foreach $line (&amp;lt;&amp;gt;) { &lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  20 &lt;/span&gt; &lt;span class=&quot;LineComment&quot;&gt;&lt;span class=&quot;LineComment&quot;&gt;#&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  21 &lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;while&lt;/span&gt; (&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;line&lt;/span&gt;=&amp;lt;&amp;gt;) {
&lt;span class=&quot;line-numbers&quot;&gt;  22 &lt;/span&gt;   &lt;span class=&quot;LineComment&quot;&gt;&lt;span class=&quot;LineComment&quot;&gt;#&lt;/span&gt; remove the newline from $line, otherwise the report will be corrupted.&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  23 &lt;/span&gt;   &lt;span class=&quot;CommandMethod&quot;&gt;chomp&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;line&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;  24 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  25 &lt;/span&gt;   &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;columns&lt;/span&gt;               = &lt;span class=&quot;CommandMethod&quot;&gt;split&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;;&lt;span class=&quot;String&quot;&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;line&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;  26 &lt;/span&gt;   &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;timestamp&lt;/span&gt;             = &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;columns&lt;/span&gt;[0];
&lt;span class=&quot;line-numbers&quot;&gt;  27 &lt;/span&gt;   &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;page_name&lt;/span&gt;             = &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;columns&lt;/span&gt;[1];
&lt;span class=&quot;line-numbers&quot;&gt;  28 &lt;/span&gt;   &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;page_runtime&lt;/span&gt;          = &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;columns&lt;/span&gt;[2];
&lt;span class=&quot;line-numbers&quot;&gt;  29 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  30 &lt;/span&gt;   &lt;span class=&quot;Keyword&quot;&gt;if&lt;/span&gt;(!&lt;span class=&quot;CommandMethod&quot;&gt;defined&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;first_timestamp&lt;/span&gt;))
&lt;span class=&quot;line-numbers&quot;&gt;  31 &lt;/span&gt;   {
&lt;span class=&quot;line-numbers&quot;&gt;  32 &lt;/span&gt;     &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;first_timestamp&lt;/span&gt; = &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;timestamp&lt;/span&gt;;
&lt;span class=&quot;line-numbers&quot;&gt;  33 &lt;/span&gt;   }
&lt;span class=&quot;line-numbers&quot;&gt;  34 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  35 &lt;/span&gt;   &lt;span class=&quot;LineComment&quot;&gt;&lt;span class=&quot;LineComment&quot;&gt;#&lt;/span&gt; print what we find&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  36 &lt;/span&gt;   &lt;span class=&quot;Keyword&quot;&gt;if&lt;/span&gt;(!&lt;span class=&quot;CommandMethod&quot;&gt;defined&lt;/span&gt;(@{&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;page_runtimes&lt;/span&gt;{&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;page_name&lt;/span&gt;}}))
&lt;span class=&quot;line-numbers&quot;&gt;  37 &lt;/span&gt;   {
&lt;span class=&quot;line-numbers&quot;&gt;  38 &lt;/span&gt;     &lt;span class=&quot;CommandMethod&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Found page '&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;page_name&lt;/span&gt;'&lt;span class=&quot;UserDefinedConstant&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;;
&lt;span class=&quot;line-numbers&quot;&gt;  39 &lt;/span&gt;   }
&lt;span class=&quot;line-numbers&quot;&gt;  40 &lt;/span&gt;  
&lt;span class=&quot;line-numbers&quot;&gt;  41 &lt;/span&gt;   &lt;span class=&quot;LineComment&quot;&gt;&lt;span class=&quot;LineComment&quot;&gt;#&lt;/span&gt; add page runtimes to one hash&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  42 &lt;/span&gt;   &lt;span class=&quot;CommandMethod&quot;&gt;push&lt;/span&gt;(@{&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;page_runtimes&lt;/span&gt;{&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;page_name&lt;/span&gt;}}, &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;page_runtime&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;  43 &lt;/span&gt;  
&lt;span class=&quot;line-numbers&quot;&gt;  44 &lt;/span&gt;   &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;last_timestamp&lt;/span&gt; = &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;timestamp&lt;/span&gt;;
&lt;span class=&quot;line-numbers&quot;&gt;  45 &lt;/span&gt; }
&lt;span class=&quot;line-numbers&quot;&gt;  46 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  47 &lt;/span&gt; &lt;span class=&quot;LineComment&quot;&gt;&lt;span class=&quot;LineComment&quot;&gt;#&lt;/span&gt; ==========================================&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  48 &lt;/span&gt; &lt;span class=&quot;LineComment&quot;&gt;&lt;span class=&quot;LineComment&quot;&gt;#&lt;/span&gt; Calculate and print page statistics&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  49 &lt;/span&gt; &lt;span class=&quot;LineComment&quot;&gt;&lt;span class=&quot;LineComment&quot;&gt;#&lt;/span&gt; ==========================================&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  50 &lt;/span&gt; &lt;span class=&quot;CommandMethod&quot;&gt;open&lt;/span&gt;(PAGE_REPORT, &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&amp;gt;report.csv&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;) &lt;span class=&quot;Operator&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;die&lt;/span&gt;(&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;Could not open report.csv.&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;  51 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  52 &lt;/span&gt; &lt;span class=&quot;CommandMethod&quot;&gt;print&lt;/span&gt; PAGE_REPORT &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;First sample&lt;span class=&quot;UserDefinedConstant&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;.&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;first_timestamp&lt;/span&gt;.&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;UserDefinedConstant&quot;&gt;\n&lt;/span&gt;Last sample&lt;span class=&quot;UserDefinedConstant&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;.&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;last_timestamp&lt;/span&gt;.&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;UserDefinedConstant&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;UserDefinedConstant&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;;
&lt;span class=&quot;line-numbers&quot;&gt;  53 &lt;/span&gt; &lt;span class=&quot;CommandMethod&quot;&gt;print&lt;/span&gt; PAGE_REPORT &lt;span class=&quot;CommandMethod&quot;&gt;join&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;delimitor&lt;/span&gt;, &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;columns&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;  54 &lt;/span&gt; 
&lt;span class=&quot;line-numbers&quot;&gt;  55 &lt;/span&gt; &lt;span class=&quot;Keyword&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;page_name&lt;/span&gt; (&lt;span class=&quot;CommandMethod&quot;&gt;keys&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;%&lt;/span&gt;page_runtimes&lt;/span&gt; )
&lt;span class=&quot;line-numbers&quot;&gt;  56 &lt;/span&gt; {
&lt;span class=&quot;line-numbers&quot;&gt;  57 &lt;/span&gt;   &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;runtimes&lt;/span&gt; = @{&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;page_runtimes&lt;/span&gt;{&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;page_name&lt;/span&gt;}};
&lt;span class=&quot;line-numbers&quot;&gt;  58 &lt;/span&gt;  
&lt;span class=&quot;line-numbers&quot;&gt;  59 &lt;/span&gt;   &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;samples&lt;/span&gt; = &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;runtimes&lt;/span&gt;;
&lt;span class=&quot;line-numbers&quot;&gt;  60 &lt;/span&gt;   &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;min&lt;/span&gt;     = min(&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;runtimes&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;  61 &lt;/span&gt;   &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;max&lt;/span&gt;     = max(&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;runtimes&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;  62 &lt;/span&gt;   &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;mean&lt;/span&gt;    = mean(&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;runtimes&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;  63 &lt;/span&gt;   &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;mode&lt;/span&gt;    = mode(&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;runtimes&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;  64 &lt;/span&gt;   &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;median&lt;/span&gt;  = median(&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;runtimes&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;  65 &lt;/span&gt;   &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;stddev&lt;/span&gt;  = stddev(&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;runtimes&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;  66 &lt;/span&gt;  
&lt;span class=&quot;line-numbers&quot;&gt;  67 &lt;/span&gt;   &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;data&lt;/span&gt; = (&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;page_name&lt;/span&gt;, &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;samples&lt;/span&gt;, &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;min&lt;/span&gt;, &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;max&lt;/span&gt;, &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;mean&lt;/span&gt;, &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;mode&lt;/span&gt;, &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;median&lt;/span&gt;, &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;stddev&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;  68 &lt;/span&gt;  
&lt;span class=&quot;line-numbers&quot;&gt;  69 &lt;/span&gt;   &lt;span class=&quot;Storage&quot;&gt;my&lt;/span&gt; &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;line&lt;/span&gt; = &lt;span class=&quot;CommandMethod&quot;&gt;join&lt;/span&gt;(&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;delimitor&lt;/span&gt;, &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;@&lt;/span&gt;data&lt;/span&gt;);
&lt;span class=&quot;line-numbers&quot;&gt;  70 &lt;/span&gt;  
&lt;span class=&quot;line-numbers&quot;&gt;  71 &lt;/span&gt;   &lt;span class=&quot;LineComment&quot;&gt;&lt;span class=&quot;LineComment&quot;&gt;#&lt;/span&gt; Use comma instead of decimal&lt;/span&gt;
&lt;span class=&quot;line-numbers&quot;&gt;  72 &lt;/span&gt;   &lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;line&lt;/span&gt; =~ &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;CommandMethod&quot;&gt;s&lt;/span&gt;/&lt;/span&gt;&lt;span class=&quot;UserDefinedConstant&quot;&gt;\.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;UserDefinedConstant&quot;&gt;\,&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;/&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;Keyword&quot;&gt;g&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;;
&lt;span class=&quot;line-numbers&quot;&gt;  73 &lt;/span&gt;  
&lt;span class=&quot;line-numbers&quot;&gt;  74 &lt;/span&gt;   &lt;span class=&quot;CommandMethod&quot;&gt;print&lt;/span&gt; PAGE_REPORT &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;Variable&quot;&gt;&lt;span class=&quot;Variable&quot;&gt;$&lt;/span&gt;line&lt;/span&gt;&lt;span class=&quot;UserDefinedConstant&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;;
&lt;span class=&quot;line-numbers&quot;&gt;  75 &lt;/span&gt; }
&lt;span class=&quot;line-numbers&quot;&gt;  76 &lt;/span&gt; &lt;span class=&quot;CommandMethod&quot;&gt;close&lt;/span&gt;(PAGE_REPORT);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;To use it simply pipe some data into it like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class=&quot;active4d&quot;&gt;&lt;span class=&quot;line-numbers&quot;&gt;   1 &lt;/span&gt; &lt;span class=&quot;CommandMethod&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;String&quot;&gt;&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;2008-31-12&lt;span class=&quot;String&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; silly-data.&lt;span class=&quot;CommandMethod&quot;&gt;log&lt;/span&gt; | perl analyze.pl
&lt;/pre&gt;&lt;/p&gt;</rendered-body>
  <title>Perl script that can be used to calculate min, max, mean, mode, median and standard deviation for a set of log records</title>
  <updated-at type="datetime">2009-04-22T10:31:41+03:00</updated-at>
</snippet>
