#51194 Issue 51165 - add more logconv stats for the new access log keywords
Closed 3 years ago by spichugi. Opened 3 years ago by mreynolds.
mreynolds/389-ds-base 51165  into  master

file modified
+86 -66
@@ -1,5 +1,4 @@ 

  #!/usr/bin/env perl

- 

  #

  # BEGIN COPYRIGHT BLOCK

  # Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
@@ -249,6 +248,12 @@ 

  my $modrdnStat;

  my $compareStat;

  my $bindCountStat;

+ my $totalEtime = 0.0;

+ my $totalWtime = 0.0;

+ my $totalOpTime = 0.0;

+ my $etimeCount = 0;

+ my $wtimeCount = 0;

+ my $opTimeCount = 0;

  my %cipher = ();

  my @removefiles = ();

  
@@ -807,7 +812,7 @@ 

  #

  # Continue with standard report

  #

- print "Restarts:                     $serverRestartCount\n";

+ print "Restarts:                      $serverRestartCount\n";

  

  if(%cipher){

  	print "Secure Protocol Versions:\n";
@@ -817,42 +822,42 @@ 

  	print "\n";

  }

  

- print "Peak Concurrent Connections:  $maxsimConnection\n";

- print "Total Operations:             $allOps\n";

- print "Total Results:                $allResults\n";

+ print "Peak Concurrent Connections:   $maxsimConnection\n";

+ print "Total Operations:              $allOps\n";

+ print "Total Results:                 $allResults\n";

  my ($perf, $tmp);

  if ($allOps ne "0"){

- 	print sprintf "Overall Performance:          %.1f%%\n\n" , ($perf = ($tmp = ($allResults / $allOps)*100) > 100 ? 100.0 : $tmp) ;

+ 	print sprintf "Overall Performance:           %.1f%%\n\n" , ($perf = ($tmp = ($allResults / $allOps)*100) > 100 ? 100.0 : $tmp) ;

  } else {

- 	print "Overall Performance:          No Operations to evaluate\n\n";

+ 	print "Overall Performance:           No Operations to evaluate\n\n";

  }

  

  format STDOUT =

- Total Connections:            @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

-                               $connectionCount, $connStat,

-  - LDAP Connections:          @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

-                               ($connectionCount - $sslCount - $ldapiCount), $ldapConnStat

-  - LDAPI Connections:         @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

-                               $ldapiCount, $ldapiConnStat

-  - LDAPS Connections:         @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

-                               $sslCount, $sslConnStat

-  - StartTLS Extended Ops:     @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

-                               $startTLSCount, $tlsConnStat

- 

- Searches:                     @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

-                               $srchCount,   $searchStat,

- Modifications:                @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

-                               $modCount,    $modStat,

- Adds:                         @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

-                               $addCount,    $addStat,

- Deletes:                      @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

-                               $delCount,    $deleteStat,

- Mod RDNs:                     @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

-                               $modrdnCount, $modrdnStat,

- Compares:                     @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

-                               $cmpCount,    $compareStat,

- Binds:                        @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

-                               $bindCount,   $bindCountStat,

+ Total Connections:             @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

+                                $connectionCount, $connStat,

+  - LDAP Connections:           @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

+                                ($connectionCount - $sslCount - $ldapiCount), $ldapConnStat

+  - LDAPI Connections:          @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

+                                $ldapiCount, $ldapiConnStat

+  - LDAPS Connections:          @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

+                                $sslCount, $sslConnStat

+  - StartTLS Extended Ops:      @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

+                                $startTLSCount, $tlsConnStat

+ 

+ Searches:                      @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

+                                $srchCount,   $searchStat,

+ Modifications:                 @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

+                                $modCount,    $modStat,

+ Adds:                          @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

+                                $addCount,    $addStat,

+ Deletes:                       @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

+                                $delCount,    $deleteStat,

+ Mod RDNs:                      @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

+                                $modrdnCount, $modrdnStat,

+ Compares:                      @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

+                                $cmpCount,    $compareStat,

+ Binds:                         @<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

+                                $bindCount,   $bindCountStat,

  .

  write STDOUT;

  
@@ -863,23 +868,32 @@ 

  }

  

  print "\n";

- print "Proxied Auth Operations:      $proxiedAuthCount\n";

- print "Persistent Searches:          $persistentSrchCount\n";

- print "Internal Operations:          $internalOpCount\n";

- print "Entry Operations:             $entryOpCount\n";

- print "Extended Operations:          $extopCount\n";

- print "Abandoned Requests:           $abandonCount\n";

- print "Smart Referrals Received:     $referralCount\n";

+ if ($wtimeCount ne "0") {

+ 	print sprintf "Average wtime (wait time):     %.9f\n", $totalWtime / $wtimeCount;

+ }

+ if ($opTimeCount ne "0") {

+ 	print sprintf "Average optime (op time):      %.9f\n", $totalOpTime / $opTimeCount;

+ }

+ print sprintf "Average etime (elapsed time):  %.9f\n", $totalEtime / $etimeCount;

+ 

+ print "\n";

+ print "Proxied Auth Operations:       $proxiedAuthCount\n";

+ print "Persistent Searches:           $persistentSrchCount\n";

+ print "Internal Operations:           $internalOpCount\n";

+ print "Entry Operations:              $entryOpCount\n";

+ print "Extended Operations:           $extopCount\n";

+ print "Abandoned Requests:            $abandonCount\n";

+ print "Smart Referrals Received:      $referralCount\n";

  print "\n";

- print "VLV Operations:               $vlvCount\n";

- print "VLV Unindexed Searches:       $vlvNotesACount\n";

- print "VLV Unindexed Components:     $vlvNotesUCount\n";

- print "SORT Operations:              $vlvSortCount\n";

+ print "VLV Operations:                $vlvCount\n";

+ print "VLV Unindexed Searches:        $vlvNotesACount\n";

+ print "VLV Unindexed Components:      $vlvNotesUCount\n";

+ print "SORT Operations:               $vlvSortCount\n";

  print "\n";

- print "Entire Search Base Queries:   $objectclassTopCount\n";

- print "Paged Searches:               $pagedSearchCount\n";

- print "Unindexed Searches:           $unindexedSrchCountNotesA\n";

- print "Unindexed Components:         $unindexedSrchCountNotesU\n";

+ print "Entire Search Base Queries:    $objectclassTopCount\n";

+ print "Paged Searches:                $pagedSearchCount\n";

+ print "Unindexed Searches:            $unindexedSrchCountNotesA\n";

+ print "Unindexed Components:          $unindexedSrchCountNotesU\n";

  

  if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){

  	if ($unindexedSrchCountNotesA > 0){
@@ -1053,7 +1067,7 @@ 

      print "\n";

  }

  

- print "Invalid Attribute Filters:    $invalidFilterCount\n";

+ print "Invalid Attribute Filters:     $invalidFilterCount\n";

  if ($invalidFilterCount > 0 && $verb eq "yes"){

      my $conn_hash = $hashes->{conn_hash};

      my $notesf_conn_op = $hashes->{notesf_conn_op};
@@ -1104,10 +1118,10 @@ 

      print "\n";

  }

  

- print "FDs Taken:                    $fdTaken\n";

- print "FDs Returned:                 $fdReturned\n";

- print "Highest FD Taken:             $highestFdTaken\n\n";

- print "Broken Pipes:                 $brokenPipeCount\n";

+ print "FDs Taken:                     $fdTaken\n";

+ print "FDs Returned:                  $fdReturned\n";

+ print "Highest FD Taken:              $highestFdTaken\n\n";

+ print "Broken Pipes:                  $brokenPipeCount\n";

  if ($brokenPipeCount > 0){

  	my $rc = $hashes->{rc};

  	my @etext;
@@ -1121,7 +1135,7 @@ 

  	print "\n";

  }

  

- print "Connections Reset By Peer:    $connResetByPeerCount\n";

+ print "Connections Reset By Peer:     $connResetByPeerCount\n";

  if ($connResetByPeerCount > 0){

  	my $src = $hashes->{src};

  	my @retext;
@@ -1135,7 +1149,7 @@ 

  	print "\n";

  }

  

- print "Resource Unavailable:         $resourceUnavailCount\n";

+ print "Resource Unavailable:          $resourceUnavailCount\n";

  if ($resourceUnavailCount > 0){

  	my $rsrc = $hashes->{rsrc};

  	my @rtext;
@@ -1147,27 +1161,27 @@ 

  	}

  	print @rtext;

  }

- print "Max BER Size Exceeded:        $maxBerSizeCount\n";

+ print "Max BER Size Exceeded:         $maxBerSizeCount\n";

  print "\n";

- print "Binds:                        $bindCount\n";

- print "Unbinds:                      $unbindCount\n";

- print "------------------------------";

+ print "Binds:                         $bindCount\n";

+ print "Unbinds:                       $unbindCount\n";

+ print "-------------------------------";

  print "-" x length $bindCount;

  print "\n";

- print " - LDAP v2 Binds:             $v2BindCount\n";

- print " - LDAP v3 Binds:             $v3BindCount\n";

- print " - AUTOBINDs(LDAPI):          $autobindCount\n";

- print " - SSL Client Binds:          $sslClientBindCount\n";

- print " - Failed SSL Client Binds:   $sslClientFailedCount\n";

- print " - SASL Binds:                $saslBindCount\n";

+ print " - LDAP v2 Binds:              $v2BindCount\n";

+ print " - LDAP v3 Binds:              $v3BindCount\n";

+ print " - AUTOBINDs(LDAPI):           $autobindCount\n";

+ print " - SSL Client Binds:           $sslClientBindCount\n";

+ print " - Failed SSL Client Binds:    $sslClientFailedCount\n";

+ print " - SASL Binds:                 $saslBindCount\n";

  if ($saslBindCount > 0){

  	my $saslmech = $hashes->{saslmech};

  	foreach my $saslb ( sort {$saslmech->{$b} <=> $saslmech->{$a} } (keys %{$saslmech}) ){

  		printf "   - %-4s: %s\n",$saslb, $saslmech->{$saslb};

  	}

  }

- print " - Directory Manager Binds:   $rootDNBindCount\n";

- print " - Anonymous Binds:           $anonymousBindCount\n";

+ print " - Directory Manager Binds:    $rootDNBindCount\n";

+ print " - Anonymous Binds:            $anonymousBindCount\n";

  

  ##########################################################################

  #                       Verbose Logging Section                          #
@@ -2572,16 +2586,22 @@ 

  	}

  	if ($_ =~ /etime= *([0-9.]+)/ ) { 

  		my $etime_val = $1;

+ 		$totalEtime = $totalEtime + $1;

+ 		$etimeCount++;

  		if ($usage =~ /t/i || $verb eq "yes"){ $hashes->{etime}->{$etime_val}++; }

  		if ($reportStats){ inc_stats_val('etime',$etime_val,$s_stats,$m_stats); }

  	}

  	if ($_ =~ /wtime= *([0-9.]+)/ ) {

  		my $wtime_val = $1;

+ 		$totalWtime = $totalWtime + $1;

+ 		$wtimeCount++;

  		if ($usage =~ /t/i || $verb eq "yes"){ $hashes->{wtime}->{$wtime_val}++; }

  		if ($reportStats){ inc_stats_val('wtime',$wtime_val,$s_stats,$m_stats); }

  	}

  	if ($_ =~ /optime= *([0-9.]+)/ ) {

  		my $optime_val = $1;

+ 		$totalOpTime = $totalOpTime + $1;

+ 		$opTimeCount++;

  		if ($usage =~ /t/i || $verb eq "yes"){ $hashes->{optime}->{$optime_val}++; }

  		if ($reportStats){ inc_stats_val('optime',$optime_val,$s_stats,$m_stats); }

  	}

Description: Add "average" stats for wtime, optime, and etime

relates: https://pagure.io/389-ds-base/issue/51165

Reviewed by: ?

Ack from me.

As an aside, at what point do we rewrite logconv to py? Sorry to open that bag of fun :)

Ack from me.
As an aside, at what point do we rewrite logconv to py? Sorry to open that bag of fun :)

There is a ticket open for it I believe. The issue is that logconv uses a special perl database to store it hashes, I don't think there is a python equivalent. Needs more investigation, but I don't think it will be an easy port to python (where it's fast and does not consume a ton of memory), fun fun :-)

Ahhhh cool, if we have a ticket for it, then no issue. Feel free to merge :) thanks mate,

rebased onto f771ff7

3 years ago

Pull-Request has been merged by mreynolds

3 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/4247

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

3 years ago
Metadata