From b9f170fea9a44429ba1c677dc681bfd7aadda99b Mon Sep 17 00:00:00 2001 From: yinle Date: Sat, 11 Aug 2012 06:56:45 +0000 Subject: [PATCH] Add print information to lsslp. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13488 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/lsslp.pm | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/lsslp.pm b/xCAT-server/lib/xcat/plugins/lsslp.pm index 4f0d5d6e3..ee0c7b754 100644 --- a/xCAT-server/lib/xcat/plugins/lsslp.pm +++ b/xCAT-server/lib/xcat/plugins/lsslp.pm @@ -515,8 +515,8 @@ sub invoke_dodiscover { $arg{Retry} = $maxt; $arg{Count} = $globalopt{C} if($globalopt{C}); $arg{Time} = $globalopt{T} if($globalopt{T}); - - my $searchmacsref = xCAT::SLP::dodiscover(%arg); + $arg{reqcallback} = $request->{callback} if($request->{callback}); + my ($searchmacsref,$sendcount,$rsp) = xCAT::SLP::dodiscover(%arg); ######################################### @@ -559,7 +559,7 @@ sub invoke_dodiscover { # $values = \%val_tmp; #} - return $searchmacsref; + return ($searchmacsref,$sendcount,$rsp); } @@ -1585,7 +1585,7 @@ sub process_request { #} #while (child_response($callback,$fds)) {} - my $searchmacsref = invoke_dodiscover(); + my ($searchmacsref,$sendcount,$rspc) = invoke_dodiscover(\%request); ########################################### # Record ending time @@ -1597,8 +1597,20 @@ sub process_request { ########################################### # Combined responses from all children ########################################### + my $num = keys %$searchmacsref; + my $min; + if ($num < 500) { + $min = "0-1"; + } elsif (500 < $num and $num < 1000) { + $min = "1-2"; + } else { + $min = "more than 2"; + } + #my $start1 = Time::HiRes::gettimeofday(); + send_msg( \%request, 0, "$sendcount requests with $rspc responses. Now processing responses. This will take $min minutes..."); format_output( \%request, $searchmacsref); - + #my $elapsed1 = Time::HiRes::gettimeofday() - $start1; + #send_msg( \%request, 0, "$num nodes takes $elapsed1"); return( SUCCESS ); }