Thank you for the replies... This is what ended up fixing the issue and speeding the script up greatly; seconds instead of minutes.
I was coverting the unix seconds into a five minute interval for graphing by overwriting the $seconds variable, using it and then adding the interval to it. Instead, I needed to retain the original value, so I needed to use a second variable for the five minute interval.
$fivemin = (int($seconds/300))*300;
foreach $cmd ('WBU', 'RTT') {
my ( $time, $interval, $n_elements, @data ) = split(/,/, $Clie
+nt{$client}{$cmd});
my $seconds = &UnixDate("$time","%s");
foreach (@data) {
if ($cmd eq 'RTT') {
$interval = 60; ### interval not set correctl
+y in dataset
$value = sprintf("%0.2f", ($_/1000));
}
else {
$interval = 30; ### interval not set correctl
+y in dataset
$value = sprintf("%0.2f", (($_*8)/1000)); #
+ Convert to bits then / by 1000 for graphing
}
$fivemin = (int($seconds/300))*300;
$Counter{$fivemin}++;
$Tot{$fivemin}+=$value;
$Max{$fivemin}=$value if ($value>$Max{$fivemin});
$Min{$fivemin}=$value if (($value<$Min{$fivemin})or(!$
+Min{$fivemin}));
$seconds+=$interval;
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.