From: Dirk Koopman Date: Thu, 17 Nov 2016 14:05:47 +0000 (+0000) Subject: change mrtg times collect again X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=c4fc9fe526a8507baeeefa157386e62a1eafb229;p=spider.git change mrtg times collect again Change the graphed values to 10ths of seconds and split out cluster from children's cpu seconds. --- diff --git a/Changes b/Changes index b118fc01..160b12da 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +17Nov16======================================================================= +1. Change method (again) of get processor seconds in cmd/mrtg.pl. Split out + main process from children and display each separately. 16Nov16======================================================================= 1. Change method of get processor seconds in cmd/mrtg.pl 18Aug16======================================================================= diff --git a/cmd/mrtg.pl b/cmd/mrtg.pl index 4a872d61..7fd950d8 100644 --- a/cmd/mrtg.pl +++ b/cmd/mrtg.pl @@ -76,15 +76,14 @@ sub do_it } if (!$main::is_win && ($want{proc} || $want{all})) { - $ENV{COLUMNS} = 250; - my $secs; + my $secs = $main::clssecs + $main::cldsecs; - $secs = clock_gettime(CLOCK_PROCESS_CPUTIME_ID); + dbg "mrtg: proc: cluster=$main::clssecs children=$main::cldsecs clock=$secs" if isdbg('mrtg'); - $mc->cfgprint('proc', [qw(noi unknaszero withzeroes perminute)], 5*60, + $mc->cfgprint('proc', [qw(unknaszero withzeroes perminute)], 600, "Processor Usage", - 'Proc Secs/Min', 'Proc Secs', 'Proc Secs') unless $want{dataonly}; - $mc->data('proc', $secs, $secs, "Processor Usage") unless $want{cfgonly}; + 'CPU 10th Secs/Min', 'Cluster Secs', 'Child Secs') unless $want{dataonly}; + $mc->data('proc', $main::clssecs*10, $main::cldsecs*10, "Processor Usage") unless $want{cfgonly}; } # do the users and nodes diff --git a/perl/cluster.pl b/perl/cluster.pl index d82dd2e7..1419e318 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -135,7 +135,7 @@ use vars qw(@inqueue $systime $starttime $lockfn @outstanding_connects $clusterport $mycall $decease $is_win $routeroot $me $reqreg $bumpexisting $allowdxby $dbh $dsn $dbuser $dbpass $do_xml $systime_days $systime_daystart $can_encode $maxconnect_user $maxconnect_node $idle_interval $log_flush_interval - $broadcast_debug + $broadcast_debug ); @inqueue = (); # the main input queue, an array of hashes @@ -155,6 +155,8 @@ $log_flush_interval = 2; # interval to wait between log flushes our $ending; # signal that we are ending; our $broadcast_debug; # allow broadcasting of debug info down "enhanced" user connections +our $clssecs; # the amount of cpu time the DXSpider process have consumed +our $cldsecs; # the amount of cpu time any child processes have consumed # send a message to call on conn and disconnect @@ -651,6 +653,7 @@ setup_start(); my $main_loop = Mojo::IOLoop->recurring($idle_interval => \&idle_loop); my $log_flush_loop = Mojo::IOLoop->recurring($log_flush_interval => \&DXLog::flushall); +my $cpusecs_loop = Mojo::IOLoop->recurring(5 => sub {my @t = times; $clssecs = $t[0]+$t[1]; $cldsecs = $t[2]+$t[3]}); Web::start_node();