<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic PERL - find MAX, MIN in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/perl-find-max-min/m-p/3617983#M104622</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am written a PERL script which calculates the average response time of a system.&lt;BR /&gt;&lt;BR /&gt;Now, I need to find the MAX time and the MIN time from the response times.&lt;BR /&gt;&lt;BR /&gt;Also, I need to find the 10% of the worst calls ( the calls which have taken the maximum times) and also find the maximum and minimum time among the worst 10% calls.&lt;BR /&gt;&lt;BR /&gt;Can anyone please help me.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Rahul</description>
    <pubDate>Fri, 02 Sep 2005 16:42:02 GMT</pubDate>
    <dc:creator>Rahul_13</dc:creator>
    <dc:date>2005-09-02T16:42:02Z</dc:date>
    <item>
      <title>PERL - find MAX, MIN</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-find-max-min/m-p/3617983#M104622</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am written a PERL script which calculates the average response time of a system.&lt;BR /&gt;&lt;BR /&gt;Now, I need to find the MAX time and the MIN time from the response times.&lt;BR /&gt;&lt;BR /&gt;Also, I need to find the 10% of the worst calls ( the calls which have taken the maximum times) and also find the maximum and minimum time among the worst 10% calls.&lt;BR /&gt;&lt;BR /&gt;Can anyone please help me.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Rahul</description>
      <pubDate>Fri, 02 Sep 2005 16:42:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-find-max-min/m-p/3617983#M104622</guid>
      <dc:creator>Rahul_13</dc:creator>
      <dc:date>2005-09-02T16:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: PERL - find MAX, MIN</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-find-max-min/m-p/3617984#M104623</link>
      <description>Hi Rahul:&lt;BR /&gt;&lt;BR /&gt;Here's a suggestion.&lt;BR /&gt;&lt;BR /&gt;One method of attack would be to collect your response time samples into a list, array or hash, depending on your processing requirements.  Having counted the total samples as you collect them, you can find the 10% (0.1 N) of the samples (N) that represent the worst response times by taking the first 10% of a list of response times sorted in descending order (longest/worst to shortest/best).&lt;BR /&gt;&lt;BR /&gt;Finding a minimum and maximum is simple too.&lt;BR /&gt;Assuming that @ary contains your response times:&lt;BR /&gt;&lt;BR /&gt;$min=2**32-1;&lt;BR /&gt;$max=0;&lt;BR /&gt;for $t (@ary) {$min=$t if $t &amp;lt; $min};&lt;BR /&gt;for $t (@ary) {$max=$t if $t &amp;gt; $max};&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 02 Sep 2005 18:51:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-find-max-min/m-p/3617984#M104623</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2005-09-02T18:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: PERL - find MAX, MIN</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-find-max-min/m-p/3617985#M104624</link>
      <description>SMOP...&lt;BR /&gt;&lt;BR /&gt;----- First create a sample data file:&lt;BR /&gt;&lt;BR /&gt;# perl -e 'while ($i++&amp;lt;70) {printf "%05d %5f\n", $i, rand}' &amp;gt; x&lt;BR /&gt;&lt;BR /&gt;------ Perl script x.p&lt;BR /&gt;$w = 10;&lt;BR /&gt;# read times into array keyed by call&lt;BR /&gt;&lt;BR /&gt;while (&amp;lt;&amp;gt;){&lt;BR /&gt; ($i,$x)=split;&lt;BR /&gt; $x{$i}=$x;&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt;# create list of calls ordered by time, and count&lt;BR /&gt;&lt;BR /&gt;@o = sort {$x{$a} &amp;lt;=&amp;gt; $x{$b}} keys %x;&lt;BR /&gt;$n = scalar @o;&lt;BR /&gt;&lt;BR /&gt;# report result &lt;BR /&gt;&lt;BR /&gt;print "There were $n calls, min time = $x{@o[0]}, max time = $x{@o[$n-1]}\nThe worst $w% calls were:\n";&lt;BR /&gt;$w *= $n/100;&lt;BR /&gt;$j = int($n - $w);&lt;BR /&gt;while ( $j &amp;lt; $n ) {&lt;BR /&gt;$i=@o[$j++];&lt;BR /&gt;print "$j $i $x{$i}\n";&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;----- sample execute&lt;BR /&gt;# perl x.p x&lt;BR /&gt;There were 70 calls, min time = 0.002133, max time = 0.990953&lt;BR /&gt;The worst 10% calls were:&lt;BR /&gt;64 00036 0.933632&lt;BR /&gt;65 00030 0.935374&lt;BR /&gt;66 00067 0.935947&lt;BR /&gt;67 00001 0.956462&lt;BR /&gt;68 00019 0.967803&lt;BR /&gt;69 00052 0.969352&lt;BR /&gt;70 00031 0.990953&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hein.</description>
      <pubDate>Sat, 03 Sep 2005 11:08:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-find-max-min/m-p/3617985#M104624</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2005-09-03T11:08:18Z</dc:date>
    </item>
  </channel>
</rss>

