[389-ds-base] branch 389-ds-base-1.4.2 updated: Ticket 51159 - dsidm ou delete fails
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.2
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.2 by this push:
new 2a2e341 Ticket 51159 - dsidm ou delete fails
2a2e341 is described below
commit 2a2e341dd1862057ff911ed53171892e69c9f29a
Author: William Brown <william(a)blackhats.net.au>
AuthorDate: Wed Jun 17 13:23:04 2020 +1000
Ticket 51159 - dsidm ou delete fails
Bug Description: delete ou would fail with a stack
trace due to incorrect variable args
Fix Description: use args.dn
https://pagure.io/389-ds-base/issue/51159
Author: William Brown <william(a)blackhats.net.au>
Review by: ???
---
src/lib389/lib389/cli_idm/organizationalunit.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib389/lib389/cli_idm/organizationalunit.py b/src/lib389/lib389/cli_idm/organizationalunit.py
index 1517b8e..d2ce82d 100644
--- a/src/lib389/lib389/cli_idm/organizationalunit.py
+++ b/src/lib389/lib389/cli_idm/organizationalunit.py
@@ -41,7 +41,7 @@ def create(inst, basedn, log, args):
_generic_create(inst, basedn, log.getChild('_generic_create'), MANY, kwargs, args)
def delete(inst, basedn, log, args):
- dn = _get_arg( args, msg="Enter dn to delete")
+ dn = _get_arg(args.dn, msg="Enter dn to delete")
_warn(dn, msg="Deleting %s %s" % (SINGULAR.__name__, dn))
_generic_delete(inst, basedn, log.getChild('_generic_delete'), SINGULAR, dn, args)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 3 months
[389-ds-base] branch 389-ds-base-1.4.3 updated: Ticket 51159 - dsidm ou delete fails
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.3
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.3 by this push:
new 66ed2c5 Ticket 51159 - dsidm ou delete fails
66ed2c5 is described below
commit 66ed2c53a9629500aa43c17462796960d8ccce90
Author: William Brown <william(a)blackhats.net.au>
AuthorDate: Wed Jun 17 13:23:04 2020 +1000
Ticket 51159 - dsidm ou delete fails
Bug Description: delete ou would fail with a stack
trace due to incorrect variable args
Fix Description: use args.dn
https://pagure.io/389-ds-base/issue/51159
Author: William Brown <william(a)blackhats.net.au>
Review by: ???
---
src/lib389/lib389/cli_idm/organizationalunit.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib389/lib389/cli_idm/organizationalunit.py b/src/lib389/lib389/cli_idm/organizationalunit.py
index 1517b8e..d2ce82d 100644
--- a/src/lib389/lib389/cli_idm/organizationalunit.py
+++ b/src/lib389/lib389/cli_idm/organizationalunit.py
@@ -41,7 +41,7 @@ def create(inst, basedn, log, args):
_generic_create(inst, basedn, log.getChild('_generic_create'), MANY, kwargs, args)
def delete(inst, basedn, log, args):
- dn = _get_arg( args, msg="Enter dn to delete")
+ dn = _get_arg(args.dn, msg="Enter dn to delete")
_warn(dn, msg="Deleting %s %s" % (SINGULAR.__name__, dn))
_generic_delete(inst, basedn, log.getChild('_generic_delete'), SINGULAR, dn, args)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 3 months
[389-ds-base] branch master updated: Ticket 50980 - fix foo_filter_rewrite
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
tbordaz pushed a commit to branch master
in repository 389-ds-base.
The following commit(s) were added to refs/heads/master by this push:
new 91c8ad4 Ticket 50980 - fix foo_filter_rewrite
91c8ad4 is described below
commit 91c8ad41d257aaa258829044386e017531f40294
Author: Thierry Bordaz <tbordaz(a)redhat.com>
AuthorDate: Mon Jun 29 13:46:09 2020 +0200
Ticket 50980 - fix foo_filter_rewrite
---
dirsrvtests/tests/suites/rewriters/basic_test.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dirsrvtests/tests/suites/rewriters/basic_test.py b/dirsrvtests/tests/suites/rewriters/basic_test.py
index 66ba108..61bbade 100644
--- a/dirsrvtests/tests/suites/rewriters/basic_test.py
+++ b/dirsrvtests/tests/suites/rewriters/basic_test.py
@@ -30,7 +30,7 @@ def test_foo_filter_rewriter(topology_st):
Test that example filter rewriter 'foo' is register and search use it
"""
- libslapd = os.path.join( topology_st.standalone.ds_paths.lib_dir, 'dirsrv/libslapd.so')
+ libslapd = os.path.join( topology_st.standalone.ds_paths.lib_dir, 'dirsrv/libslapd.so.0')
# register foo filter rewriters
topology_st.standalone.add_s(Entry((
"cn=foo_filter,cn=rewriters,cn=config", {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 3 months
[389-ds-base] branch 389-ds-base-1.4.2 updated: Issue 51165 - add more logconv stats for the new access log keywords
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.2
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.2 by this push:
new edda830 Issue 51165 - add more logconv stats for the new access log keywords
edda830 is described below
commit edda8308c781429f74d0f495503f8345e9afd7a5
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Sun Jun 28 15:46:59 2020 -0400
Issue 51165 - add more logconv stats for the new access log keywords
Description: Add "average" stats for wtime, optime, and etime
relates: https://pagure.io/389-ds-base/issue/51165
Reviewed by: firstyear(Thanks!)
---
ldap/admin/src/logconv.pl | 152 ++++++++++++++++++++++++++--------------------
1 file changed, 86 insertions(+), 66 deletions(-)
diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl
index 1ed44a8..d23bfb3 100755
--- a/ldap/admin/src/logconv.pl
+++ b/ldap/admin/src/logconv.pl
@@ -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 $deleteStat;
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 @@ if ($totalTimeInNsecs == 0){
#
# Continue with standard report
#
-print "Restarts: $serverRestartCount\n";
+print "Restarts: $serverRestartCount\n";
if(%cipher){
print "Secure Protocol Versions:\n";
@@ -817,42 +822,42 @@ if(%cipher){
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 @@ sub dummy {
}
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 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
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 @@ if ($invalidFilterCount > 0 && $verb eq "yes"){
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 @@ if ($brokenPipeCount > 0){
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 @@ if ($connResetByPeerCount > 0){
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 @@ if ($resourceUnavailCount > 0){
}
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 @@ sub parseLineNormal
}
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); }
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 3 months
[389-ds-base] branch 389-ds-base-1.4.3 updated: Issue 51165 - add more logconv stats for the new access log keywords
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.3
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.3 by this push:
new 87ca196 Issue 51165 - add more logconv stats for the new access log keywords
87ca196 is described below
commit 87ca1963ed3b467117a97b693b0c4caf7ec75898
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Sun Jun 28 15:46:59 2020 -0400
Issue 51165 - add more logconv stats for the new access log keywords
Description: Add "average" stats for wtime, optime, and etime
relates: https://pagure.io/389-ds-base/issue/51165
Reviewed by: firstyear(Thanks!)
---
ldap/admin/src/logconv.pl | 152 ++++++++++++++++++++++++++--------------------
1 file changed, 86 insertions(+), 66 deletions(-)
diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl
index 1ed44a8..d23bfb3 100755
--- a/ldap/admin/src/logconv.pl
+++ b/ldap/admin/src/logconv.pl
@@ -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 $deleteStat;
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 @@ if ($totalTimeInNsecs == 0){
#
# Continue with standard report
#
-print "Restarts: $serverRestartCount\n";
+print "Restarts: $serverRestartCount\n";
if(%cipher){
print "Secure Protocol Versions:\n";
@@ -817,42 +822,42 @@ if(%cipher){
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 @@ sub dummy {
}
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 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
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 @@ if ($invalidFilterCount > 0 && $verb eq "yes"){
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 @@ if ($brokenPipeCount > 0){
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 @@ if ($connResetByPeerCount > 0){
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 @@ if ($resourceUnavailCount > 0){
}
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 @@ sub parseLineNormal
}
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); }
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 3 months
[389-ds-base] branch 389-ds-base-1.4.2 updated: Issue 51165 - add new access log keywords for wtime and optime
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.2
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.2 by this push:
new 19b6caf Issue 51165 - add new access log keywords for wtime and optime
19b6caf is described below
commit 19b6cafb93e3e2aac1ad6b242eb0c4d63b2b9ee2
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Tue Jun 23 16:38:55 2020 -0400
Issue 51165 - add new access log keywords for wtime and optime
Description: In addition to the "etime" stat in the access we can also
add the time the operation spent in the work queue, and
how long the actual operation took. We now have "wtime"
and "optime" to track these stats in the access log.
Also updated logconf for notes=F (related to a different
ticket), and stats for wtime and optime.
relates: https://pagure.io/389-ds-base/issue/51165
Reviewed by: ?
---
ldap/admin/src/logconv.pl | 187 ++++++++++++++++++++++++++++++++++----
ldap/servers/slapd/add.c | 3 +
ldap/servers/slapd/bind.c | 4 +
ldap/servers/slapd/delete.c | 3 +
ldap/servers/slapd/modify.c | 3 +
ldap/servers/slapd/modrdn.c | 3 +
ldap/servers/slapd/operation.c | 24 +++++
ldap/servers/slapd/opshared.c | 3 +
ldap/servers/slapd/result.c | 49 ++++++----
ldap/servers/slapd/slap.h | 13 +--
ldap/servers/slapd/slapi-plugin.h | 26 +++++-
11 files changed, 269 insertions(+), 49 deletions(-)
diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl
index f4808a1..1ed44a8 100755
--- a/ldap/admin/src/logconv.pl
+++ b/ldap/admin/src/logconv.pl
@@ -3,7 +3,7 @@
#
# BEGIN COPYRIGHT BLOCK
# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
-# Copyright (C) 2013 Red Hat, Inc.
+# Copyright (C) 2020 Red Hat, Inc.
# All rights reserved.
#
# License: GPL (version 3 or any later version).
@@ -55,7 +55,7 @@ my $reportStats = "";
my $dataLocation = "/tmp";
my $startTLSoid = "1.3.6.1.4.1.1466.20037";
my @statnames=qw(last last_str results srch add mod modrdn moddn cmp del abandon
- conns sslconns bind anonbind unbind notesA notesU etime);
+ conns sslconns bind anonbind unbind notesA notesU notesF etime);
my $s_stats;
my $m_stats;
my $verb = "no";
@@ -211,6 +211,7 @@ my $sslClientBindCount = 0;
my $sslClientFailedCount = 0;
my $objectclassTopCount= 0;
my $pagedSearchCount = 0;
+my $invalidFilterCount = 0;
my $bindCount = 0;
my $filterCount = 0;
my $baseCount = 0;
@@ -258,7 +259,7 @@ map {$conn{$_} = $_} @conncodes;
# hash db-backed hashes
my @hashnames = qw(attr rc src rsrc excount conn_hash ip_hash conncount nentries
filter base ds6xbadpwd saslmech saslconnop bindlist etime oid
- start_time_of_connection end_time_of_connection
+ start_time_of_connection end_time_of_connection notesf_conn_op
notesa_conn_op notesu_conn_op etime_conn_op nentries_conn_op
optype_conn_op time_conn_op srch_conn_op del_conn_op mod_conn_op
mdn_conn_op cmp_conn_op bind_conn_op unbind_conn_op ext_conn_op
@@ -926,7 +927,7 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
}
while($op > 0){
# The bind op is not the same as the search op that triggered the notes=A.
- # We have adjust the key by decrementing the op count until we find the last bind op.
+ # We have to adjust the key by decrementing the op count until we find the last bind op.
$op--;
$binddn_key = "$srvRstCnt,$conn,$op";
if (exists($bind_conn_op->{$binddn_key}) && defined($bind_conn_op->{$binddn_key})) {
@@ -1049,9 +1050,60 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
}
}
}
-} # end of unindexed search report
+ print "\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};
+ my $time_conn_op = $hashes->{time_conn_op};
+ my $etime_conn_op = $hashes->{etime_conn_op};
+ my $nentries_conn_op = $hashes->{nentries_conn_op};
+ my $filter_conn_op = $hashes->{filter_conn_op};
+ my $bind_conn_op = $hashes->{bind_conn_op};
+ my $notesCount = 1;
+ my $unindexedIp;
+ my $binddn_key;
+ my %uniqFilt = (); # hash of unique filters
+ my %uniqFilter = (); # hash of unique filters bind dn
+ my %uniqBindDNs = (); # hash of unique bind dn's
+ my %uniqBindFilters = (); # hash of filters for a bind DN
+
+ while (my ($srcnt_conn_op, $count) = each %{$notesf_conn_op}) {
+ my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op);
+ my $attrIp = getIPfromConn($conn, $srvRstCnt);
+ print "\n Invalid Attribute Filter #".$notesCount." (notes=F)\n";
+ print " - Date/Time: $time_conn_op->{$srcnt_conn_op}\n";
+ print " - Connection Number: $conn\n";
+ print " - Operation Number: $op\n";
+ print " - Etime: $etime_conn_op->{$srcnt_conn_op}\n";
+ print " - Nentries: $nentries_conn_op->{$srcnt_conn_op}\n";
+ print " - IP Address: $attrIp\n";
+ if (exists($filter_conn_op->{$srcnt_conn_op}) && defined($filter_conn_op->{$srcnt_conn_op})) {
+ print " - Search Filter: $filter_conn_op->{$srcnt_conn_op}\n";
+ $uniqFilt{$filter_conn_op->{$srcnt_conn_op}}++;
+ }
+ while($op > 0){
+ # The bind op is not the same as the search op that triggered the notes=A.
+ # We have to adjust the key by decrementing the op count until we find the last bind op.
+ $op--;
+ $binddn_key = "$srvRstCnt,$conn,$op";
+ if (exists($bind_conn_op->{$binddn_key}) && defined($bind_conn_op->{$binddn_key})) {
+ print " - Bind DN: $bind_conn_op->{$binddn_key}\n";
+ $uniqBindDNs{$bind_conn_op->{$binddn_key}}++;
+ if( $uniqFilt{$filter_conn_op->{$srcnt_conn_op}} && defined($filter_conn_op->{$srcnt_conn_op})) {
+ $uniqBindFilters{$bind_conn_op->{$binddn_key}}{$filter_conn_op->{$srcnt_conn_op}}++;
+ $uniqFilter{$filter_conn_op->{$srcnt_conn_op}}{$bind_conn_op->{$binddn_key}}++;
+ }
+ last;
+ }
+ }
+ $notesCount++;
+ }
+ print "\n";
+}
-print "\n";
print "FDs Taken: $fdTaken\n";
print "FDs Returned: $fdReturned\n";
print "Highest FD Taken: $highestFdTaken\n\n";
@@ -1386,20 +1438,20 @@ if ($usage =~ /l/ || $verb eq "yes"){
}
}
-#########################################
-# #
-# Gather and Process the unique etimes #
-# #
-#########################################
+##############################################################
+# #
+# Gather and Process the unique etimes, wtimes, and optimes #
+# #
+##############################################################
my $first;
if ($usage =~ /t/i || $verb eq "yes"){
+ # Print the elapsed times (etime)
+
my $etime = $hashes->{etime};
my @ekeys = keys %{$etime};
- #
# print most often etimes
- #
- print "\n\n----- Top $sizeCount Most Frequent etimes -----\n\n";
+ print "\n\n----- Top $sizeCount Most Frequent etimes (elapsed times) -----\n\n";
my $eloop = 0;
my $retime = 0;
foreach my $et (sort { $etime->{$b} <=> $etime->{$a} } @ekeys) {
@@ -1411,16 +1463,84 @@ if ($usage =~ /t/i || $verb eq "yes"){
printf "%-8s %-12s\n", $etime->{ $et }, "etime=$et";
$eloop++;
}
- #
+ if ($eloop == 0) {
+ print "None";
+ }
# print longest etimes
- #
- print "\n\n----- Top $sizeCount Longest etimes -----\n\n";
+ print "\n\n----- Top $sizeCount Longest etimes (elapsed times) -----\n\n";
$eloop = 0;
foreach my $et (sort { $b <=> $a } @ekeys) {
if ($eloop == $sizeCount) { last; }
printf "%-12s %-10s\n","etime=$et",$etime->{ $et };
$eloop++;
}
+ if ($eloop == 0) {
+ print "None";
+ }
+
+ # Print the wait times (wtime)
+
+ my $wtime = $hashes->{wtime};
+ my @wkeys = keys %{$wtime};
+ # print most often wtimes
+ print "\n\n----- Top $sizeCount Most Frequent wtimes (wait times) -----\n\n";
+ $eloop = 0;
+ $retime = 0;
+ foreach my $et (sort { $wtime->{$b} <=> $wtime->{$a} } @wkeys) {
+ if ($eloop == $sizeCount) { last; }
+ if ($retime ne "2"){
+ $first = $et;
+ $retime = "2";
+ }
+ printf "%-8s %-12s\n", $wtime->{ $et }, "wtime=$et";
+ $eloop++;
+ }
+ if ($eloop == 0) {
+ print "None";
+ }
+ # print longest wtimes
+ print "\n\n----- Top $sizeCount Longest wtimes (wait times) -----\n\n";
+ $eloop = 0;
+ foreach my $et (sort { $b <=> $a } @wkeys) {
+ if ($eloop == $sizeCount) { last; }
+ printf "%-12s %-10s\n","wtime=$et",$wtime->{ $et };
+ $eloop++;
+ }
+ if ($eloop == 0) {
+ print "None";
+ }
+
+ # Print the operation times (optime)
+
+ my $optime = $hashes->{optime};
+ my @opkeys = keys %{$optime};
+ # print most often optimes
+ print "\n\n----- Top $sizeCount Most Frequent optimes (actual operation times) -----\n\n";
+ $eloop = 0;
+ $retime = 0;
+ foreach my $et (sort { $optime->{$b} <=> $optime->{$a} } @opkeys) {
+ if ($eloop == $sizeCount) { last; }
+ if ($retime ne "2"){
+ $first = $et;
+ $retime = "2";
+ }
+ printf "%-8s %-12s\n", $optime->{ $et }, "optime=$et";
+ $eloop++;
+ }
+ if ($eloop == 0) {
+ print "None";
+ }
+ # print longest optimes
+ print "\n\n----- Top $sizeCount Longest optimes (actual operation times) -----\n\n";
+ $eloop = 0;
+ foreach my $et (sort { $b <=> $a } @opkeys) {
+ if ($eloop == $sizeCount) { last; }
+ printf "%-12s %-10s\n","optime=$et",$optime->{ $et };
+ $eloop++;
+ }
+ if ($eloop == 0) {
+ print "None";
+ }
}
#######################################
@@ -2152,6 +2272,26 @@ sub parseLineNormal
if (m/ RESULT err=/ && m/ notes=[A-Z,]*P/){
$pagedSearchCount++;
}
+ if (m/ RESULT err=/ && m/ notes=[A-Z,]*F/){
+ $invalidFilterCount++;
+ $con = "";
+ if ($_ =~ /conn= *([0-9A-Z]+)/i){
+ $con = $1;
+ if ($_ =~ /op= *([0-9\-]+)/i){ $op = $1;}
+ }
+
+ if($reportStats){ inc_stats('notesF',$s_stats,$m_stats); }
+ if ($usage =~ /u/ || $usage =~ /U/ || $verb eq "yes"){
+ if($_ =~ /etime= *([0-9.]+)/i ){
+ if($1 >= $minEtime){
+ $hashes->{etime_conn_op}->{"$serverRestartCount,$con,$op"} = $1;
+ $hashes->{notesf_conn_op}->{"$serverRestartCount,$con,$op"}++;
+ if ($_ =~ / *([0-9a-z:\/]+)/i){ $hashes->{time_conn_op}->{"$serverRestartCount,$con,$op"} = $1; }
+ if ($_ =~ /nentries= *([0-9]+)/i ){ $hashes->{nentries_conn_op}->{"$serverRestartCount,$con,$op"} = $1; }
+ }
+ }
+ }
+ }
if (m/ notes=[A-Z,]*A/){
$con = "";
if ($_ =~ /conn= *([0-9A-Z]+)/i){
@@ -2435,6 +2575,16 @@ sub parseLineNormal
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;
+ 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;
+ if ($usage =~ /t/i || $verb eq "yes"){ $hashes->{optime}->{$optime_val}++; }
+ if ($reportStats){ inc_stats_val('optime',$optime_val,$s_stats,$m_stats); }
+ }
if ($_ =~ / tag=101 / || $_ =~ / tag=111 / || $_ =~ / tag=100 / || $_ =~ / tag=115 /){
if ($_ =~ / nentries= *([0-9]+)/i ){
my $nents = $1;
@@ -2555,7 +2705,7 @@ sub parseLineNormal
}
}
}
- if (/ RESULT err=/ && / tag=97 nentries=0 etime=/ && $_ =~ /dn=\"(.*)\"/i){
+ if (/ RESULT err=/ && / tag=97 nentries=0 / && $_ =~ /dn=\"(.*)\"/i){
# Check if this is a sasl bind, if see we need to add the RESULT's dn as a bind dn
my $binddn = $1;
my ($conn, $op);
@@ -2680,6 +2830,7 @@ print_stats_block
$stats->{'unbind'},
$stats->{'notesA'},
$stats->{'notesU'},
+ $stats->{'notesF'},
$stats->{'etime'}),
"\n" );
} else {
diff --git a/ldap/servers/slapd/add.c b/ldap/servers/slapd/add.c
index 06ca1ee..52c64fa 100644
--- a/ldap/servers/slapd/add.c
+++ b/ldap/servers/slapd/add.c
@@ -441,6 +441,9 @@ op_shared_add(Slapi_PBlock *pb)
internal_op = operation_is_flag_set(operation, OP_FLAG_INTERNAL);
pwpolicy = new_passwdPolicy(pb, slapi_entry_get_dn(e));
+ /* Set the time we actually started the operation */
+ slapi_operation_set_time_started(operation);
+
/* target spec is used to decide which plugins are applicable for the operation */
operation_set_target_spec(operation, slapi_entry_get_sdn(e));
diff --git a/ldap/servers/slapd/bind.c b/ldap/servers/slapd/bind.c
index 1532f36..14f902c 100644
--- a/ldap/servers/slapd/bind.c
+++ b/ldap/servers/slapd/bind.c
@@ -87,6 +87,10 @@ do_bind(Slapi_PBlock *pb)
send_ldap_result(pb, LDAP_OPERATIONS_ERROR, NULL, NULL, 0, NULL);
goto free_and_return;
}
+
+ /* Set the time we actually started the operation */
+ slapi_operation_set_time_started(pb_op);
+
ber = pb_op->o_ber;
/*
diff --git a/ldap/servers/slapd/delete.c b/ldap/servers/slapd/delete.c
index c0e61ad..1a72093 100644
--- a/ldap/servers/slapd/delete.c
+++ b/ldap/servers/slapd/delete.c
@@ -236,6 +236,9 @@ op_shared_delete(Slapi_PBlock *pb)
slapi_pblock_get(pb, SLAPI_OPERATION, &operation);
internal_op = operation_is_flag_set(operation, OP_FLAG_INTERNAL);
+ /* Set the time we actually started the operation */
+ slapi_operation_set_time_started(operation);
+
sdn = slapi_sdn_new_dn_byval(rawdn);
dn = slapi_sdn_get_dn(sdn);
slapi_pblock_set(pb, SLAPI_DELETE_TARGET_SDN, (void *)sdn);
diff --git a/ldap/servers/slapd/modify.c b/ldap/servers/slapd/modify.c
index 259bedf..a186dbd 100644
--- a/ldap/servers/slapd/modify.c
+++ b/ldap/servers/slapd/modify.c
@@ -626,6 +626,9 @@ op_shared_modify(Slapi_PBlock *pb, int pw_change, char *old_pw)
slapi_pblock_get(pb, SLAPI_SKIP_MODIFIED_ATTRS, &skip_modified_attrs);
slapi_pblock_get(pb, SLAPI_CONNECTION, &pb_conn);
+ /* Set the time we actually started the operation */
+ slapi_operation_set_time_started(operation);
+
if (sdn) {
passin_sdn = 1;
} else {
diff --git a/ldap/servers/slapd/modrdn.c b/ldap/servers/slapd/modrdn.c
index 3efe584..e04916b 100644
--- a/ldap/servers/slapd/modrdn.c
+++ b/ldap/servers/slapd/modrdn.c
@@ -417,6 +417,9 @@ op_shared_rename(Slapi_PBlock *pb, int passin_args)
internal_op = operation_is_flag_set(operation, OP_FLAG_INTERNAL);
slapi_pblock_get(pb, SLAPI_CONNECTION, &pb_conn);
+ /* Set the time we actually started the operation */
+ slapi_operation_set_time_started(operation);
+
/*
* If ownership has not been passed to this function, we replace the
* string input fields within the pblock with strdup'd copies. Why?
diff --git a/ldap/servers/slapd/operation.c b/ldap/servers/slapd/operation.c
index ff16cd9..4dd3481 100644
--- a/ldap/servers/slapd/operation.c
+++ b/ldap/servers/slapd/operation.c
@@ -651,3 +651,27 @@ slapi_operation_time_expiry(Slapi_Operation *o, time_t timeout, struct timespec
{
slapi_timespec_expire_rel(timeout, &(o->o_hr_time_rel), expiry);
}
+
+/* Set the time the operation actually started */
+void
+slapi_operation_set_time_started(Slapi_Operation *o)
+{
+ clock_gettime(CLOCK_MONOTONIC, &(o->o_hr_time_started_rel));
+}
+
+/* The time diff of how long the operation took once it actually started */
+void
+slapi_operation_op_time_elapsed(Slapi_Operation *o, struct timespec *elapsed)
+{
+ struct timespec o_hr_time_now;
+ clock_gettime(CLOCK_MONOTONIC, &o_hr_time_now);
+
+ slapi_timespec_diff(&o_hr_time_now, &(o->o_hr_time_started_rel), elapsed);
+}
+
+/* The time diff the operation waited in the work queue */
+void
+slapi_operation_workq_time_elapsed(Slapi_Operation *o, struct timespec *elapsed)
+{
+ slapi_timespec_diff(&(o->o_hr_time_started_rel), &(o->o_hr_time_rel), elapsed);
+}
diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c
index d06d49b..719d5ed 100644
--- a/ldap/servers/slapd/opshared.c
+++ b/ldap/servers/slapd/opshared.c
@@ -276,6 +276,9 @@ op_shared_search(Slapi_PBlock *pb, int send_result)
slapi_pblock_get(pb, SLAPI_SEARCH_TARGET_SDN, &sdn);
slapi_pblock_get(pb, SLAPI_OPERATION, &operation);
+ /* Set the time we actually started the operation */
+ slapi_operation_set_time_started(operation);
+
if (NULL == sdn) {
sdn = slapi_sdn_new_dn_byval(base);
slapi_pblock_set(pb, SLAPI_SEARCH_TARGET_SDN, sdn);
diff --git a/ldap/servers/slapd/result.c b/ldap/servers/slapd/result.c
index 0b13c30..61efb6f 100644
--- a/ldap/servers/slapd/result.c
+++ b/ldap/servers/slapd/result.c
@@ -1975,6 +1975,8 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
CSN *operationcsn = NULL;
char csn_str[CSN_STRSIZE + 5];
char etime[ETIME_BUFSIZ] = {0};
+ char wtime[ETIME_BUFSIZ] = {0};
+ char optime[ETIME_BUFSIZ] = {0};
int pr_idx = -1;
int pr_cookie = -1;
uint32_t operation_notes;
@@ -1982,19 +1984,26 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
int32_t op_id;
int32_t op_internal_id;
int32_t op_nested_count;
+ struct timespec o_hr_time_end;
get_internal_conn_op(&connid, &op_id, &op_internal_id, &op_nested_count);
-
slapi_pblock_get(pb, SLAPI_PAGED_RESULTS_INDEX, &pr_idx);
slapi_pblock_get(pb, SLAPI_PAGED_RESULTS_COOKIE, &pr_cookie);
-
internal_op = operation_is_flag_set(op, OP_FLAG_INTERNAL);
- struct timespec o_hr_time_end;
+ /* total elapsed time */
slapi_operation_time_elapsed(op, &o_hr_time_end);
+ snprintf(etime, ETIME_BUFSIZ, "%" PRId64 ".%.09" PRId64 "", (int64_t)o_hr_time_end.tv_sec, (int64_t)o_hr_time_end.tv_nsec);
+
+ /* wait time */
+ slapi_operation_workq_time_elapsed(op, &o_hr_time_end);
+ snprintf(wtime, ETIME_BUFSIZ, "%" PRId64 ".%.09" PRId64 "", (int64_t)o_hr_time_end.tv_sec, (int64_t)o_hr_time_end.tv_nsec);
+
+ /* op time */
+ slapi_operation_op_time_elapsed(op, &o_hr_time_end);
+ snprintf(optime, ETIME_BUFSIZ, "%" PRId64 ".%.09" PRId64 "", (int64_t)o_hr_time_end.tv_sec, (int64_t)o_hr_time_end.tv_nsec);
- snprintf(etime, ETIME_BUFSIZ, "%" PRId64 ".%.09" PRId64 "", (int64_t)o_hr_time_end.tv_sec, (int64_t)o_hr_time_end.tv_nsec);
operation_notes = slapi_pblock_get_operation_notes(pb);
@@ -2025,16 +2034,16 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
if (!internal_op) {
slapi_log_access(LDAP_DEBUG_STATS,
"conn=%" PRIu64 " op=%d RESULT err=%d"
- " tag=%" BERTAG_T " nentries=%d etime=%s%s%s"
+ " tag=%" BERTAG_T " nentries=%d wtime=%s optime=%s etime=%s%s%s"
", SASL bind in progress\n",
op->o_connid,
op->o_opid,
err, tag, nentries,
- etime,
+ wtime, optime, etime,
notes_str, csn_str);
} else {
-#define LOG_SASLMSG_FMT " tag=%" BERTAG_T " nentries=%d etime=%s%s%s, SASL bind in progress\n"
+#define LOG_SASLMSG_FMT " tag=%" BERTAG_T " nentries=%d wtime=%s optime=%s etime=%s%s%s, SASL bind in progress\n"
slapi_log_access(LDAP_DEBUG_ARGS,
connid == 0 ? LOG_CONN_OP_FMT_INT_INT LOG_SASLMSG_FMT :
LOG_CONN_OP_FMT_EXT_INT LOG_SASLMSG_FMT,
@@ -2043,7 +2052,7 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
op_internal_id,
op_nested_count,
err, tag, nentries,
- etime,
+ wtime, optime, etime,
notes_str, csn_str);
}
} else if (op->o_tag == LDAP_REQ_BIND && err == LDAP_SUCCESS) {
@@ -2057,15 +2066,15 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
if (!internal_op) {
slapi_log_access(LDAP_DEBUG_STATS,
"conn=%" PRIu64 " op=%d RESULT err=%d"
- " tag=%" BERTAG_T " nentries=%d etime=%s%s%s"
+ " tag=%" BERTAG_T " nentries=%d wtime=%s optime=%s etime=%s%s%s"
" dn=\"%s\"\n",
op->o_connid,
op->o_opid,
err, tag, nentries,
- etime,
+ wtime, optime, etime,
notes_str, csn_str, dn ? dn : "");
} else {
-#define LOG_BINDMSG_FMT " tag=%" BERTAG_T " nentries=%d etime=%s%s%s dn=\"%s\"\n"
+#define LOG_BINDMSG_FMT " tag=%" BERTAG_T " nentries=%d wtime=%s optime=%s etime=%s%s%s dn=\"%s\"\n"
slapi_log_access(LDAP_DEBUG_ARGS,
connid == 0 ? LOG_CONN_OP_FMT_INT_INT LOG_BINDMSG_FMT :
LOG_CONN_OP_FMT_EXT_INT LOG_BINDMSG_FMT,
@@ -2074,7 +2083,7 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
op_internal_id,
op_nested_count,
err, tag, nentries,
- etime,
+ wtime, optime, etime,
notes_str, csn_str, dn ? dn : "");
}
slapi_ch_free((void **)&dn);
@@ -2083,15 +2092,15 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
if (!internal_op) {
slapi_log_access(LDAP_DEBUG_STATS,
"conn=%" PRIu64 " op=%d RESULT err=%d"
- " tag=%" BERTAG_T " nentries=%d etime=%s%s%s"
+ " tag=%" BERTAG_T " nentries=%d wtime=%s optime=%s etime=%s%s%s"
" pr_idx=%d pr_cookie=%d\n",
op->o_connid,
op->o_opid,
err, tag, nentries,
- etime,
+ wtime, optime, etime,
notes_str, csn_str, pr_idx, pr_cookie);
} else {
-#define LOG_PRMSG_FMT " tag=%" BERTAG_T " nentries=%d etime=%s%s%s pr_idx=%d pr_cookie=%d \n"
+#define LOG_PRMSG_FMT " tag=%" BERTAG_T " nentries=%d wtime=%s optime=%s etime=%s%s%s pr_idx=%d pr_cookie=%d \n"
slapi_log_access(LDAP_DEBUG_ARGS,
connid == 0 ? LOG_CONN_OP_FMT_INT_INT LOG_PRMSG_FMT :
LOG_CONN_OP_FMT_EXT_INT LOG_PRMSG_FMT,
@@ -2100,7 +2109,7 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
op_internal_id,
op_nested_count,
err, tag, nentries,
- etime,
+ wtime, optime, etime,
notes_str, csn_str, pr_idx, pr_cookie);
}
} else if (!internal_op) {
@@ -2114,11 +2123,11 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
}
slapi_log_access(LDAP_DEBUG_STATS,
"conn=%" PRIu64 " op=%d RESULT err=%d"
- " tag=%" BERTAG_T " nentries=%d etime=%s%s%s%s\n",
+ " tag=%" BERTAG_T " nentries=%d wtime=%s optime=%s etime=%s%s%s%s\n",
op->o_connid,
op->o_opid,
err, tag, nentries,
- etime,
+ wtime, optime, etime,
notes_str, csn_str, ext_str);
if (pbtxt) {
/* if !pbtxt ==> ext_str == "". Don't free ext_str. */
@@ -2126,7 +2135,7 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
}
} else {
int optype;
-#define LOG_MSG_FMT " tag=%" BERTAG_T " nentries=%d etime=%s%s%s\n"
+#define LOG_MSG_FMT " tag=%" BERTAG_T " nentries=%d wtime=%s optime=%s etime=%s%s%s\n"
slapi_log_access(LDAP_DEBUG_ARGS,
connid == 0 ? LOG_CONN_OP_FMT_INT_INT LOG_MSG_FMT :
LOG_CONN_OP_FMT_EXT_INT LOG_MSG_FMT,
@@ -2135,7 +2144,7 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
op_internal_id,
op_nested_count,
err, tag, nentries,
- etime,
+ wtime, optime, etime,
notes_str, csn_str);
/*
* If this is an unindexed search we should log it in the error log if
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
index 65c7560..eb981d8 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -1536,16 +1536,17 @@ typedef struct slapi_operation_results
*/
typedef struct op
{
- BerElement *o_ber; /* ber of the request */
- ber_int_t o_msgid; /* msgid of the request */
- ber_tag_t o_tag; /* tag of the request */
+ BerElement *o_ber; /* ber of the request */
+ ber_int_t o_msgid; /* msgid of the request */
+ ber_tag_t o_tag; /* tag of the request */
struct timespec o_hr_time_rel; /* internal system time op initiated */
struct timespec o_hr_time_utc; /* utc system time op initiated */
- int o_isroot; /* requestor is manager */
+ struct timespec o_hr_time_started_rel; /* internal system time op started */
+ int o_isroot; /* requestor is manager */
Slapi_DN o_sdn; /* dn bound when op was initiated */
- char *o_authtype; /* auth method used to bind dn */
+ char *o_authtype; /* auth method used to bind dn */
int o_ssf; /* ssf for this operation (highest between SASL and TLS/SSL) */
- int o_opid; /* id of this operation */
+ int o_opid; /* id of this operation */
PRUint64 o_connid; /* id of conn initiating this op; for logging only */
void *o_handler_data;
result_handler o_result_handler;
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index e6c6d0d..b78395d 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -8207,13 +8207,29 @@ void slapi_operation_time_elapsed(Slapi_Operation *o, struct timespec *elapsed);
*/
void slapi_operation_time_initiated(Slapi_Operation *o, struct timespec *initiated);
/**
- * Given an operation and a timeout, return a populate struct with the expiry
- * time of the operation suitable for checking with slapi_timespec_expire_check
+ * Given an operation, determine the time elapsed since the op
+ * was actually started.
*
- * \param Slapi_Operation o - the operation that is in progress
- * \param time_t timeout the seconds relative to operation initiation to expiry at.
- * \param struct timespec *expiry the timespec to popluate with the relative expiry.
+ * \param Slapi_Operation o - the operation which is inprogress
+ * \param struct timespec *elapsed - location where the time difference will be
+ * placed.
+ */
+void slapi_operation_op_time_elapsed(Slapi_Operation *o, struct timespec *elapsed);
+/**
+ * Given an operation, determine the time elapsed that the op spent
+ * in the work queue before actually being dispatched to a worker thread
+ *
+ * \param Slapi_Operation o - the operation which is inprogress
+ * \param struct timespec *elapsed - location where the time difference will be
+ * placed.
+ */
+void slapi_operation_workq_time_elapsed(Slapi_Operation *o, struct timespec *elapsed);
+/**
+ * Set the time the operation actually started
+ *
+ * \param Slapi_Operation o - the operation which is inprogress
*/
+void slapi_operation_set_time_started(Slapi_Operation *o);
#endif
/**
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 3 months
[389-ds-base] branch 389-ds-base-1.4.3 updated: Issue 51165 - add new access log keywords for wtime and optime
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.3
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.3 by this push:
new 0f97891 Issue 51165 - add new access log keywords for wtime and optime
0f97891 is described below
commit 0f97891f6a352ca6e4fe2cb8cc71750c04e1e357
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Tue Jun 23 16:38:55 2020 -0400
Issue 51165 - add new access log keywords for wtime and optime
Description: In addition to the "etime" stat in the access we can also
add the time the operation spent in the work queue, and
how long the actual operation took. We now have "wtime"
and "optime" to track these stats in the access log.
Also updated logconf for notes=F (related to a different
ticket), and stats for wtime and optime.
relates: https://pagure.io/389-ds-base/issue/51165
Reviewed by: ?
---
ldap/admin/src/logconv.pl | 187 ++++++++++++++++++++++++++++++++++----
ldap/servers/slapd/add.c | 3 +
ldap/servers/slapd/bind.c | 4 +
ldap/servers/slapd/delete.c | 3 +
ldap/servers/slapd/modify.c | 3 +
ldap/servers/slapd/modrdn.c | 3 +
ldap/servers/slapd/operation.c | 24 +++++
ldap/servers/slapd/opshared.c | 3 +
ldap/servers/slapd/result.c | 49 ++++++----
ldap/servers/slapd/slap.h | 13 +--
ldap/servers/slapd/slapi-plugin.h | 26 +++++-
11 files changed, 269 insertions(+), 49 deletions(-)
diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl
index f4808a1..1ed44a8 100755
--- a/ldap/admin/src/logconv.pl
+++ b/ldap/admin/src/logconv.pl
@@ -3,7 +3,7 @@
#
# BEGIN COPYRIGHT BLOCK
# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
-# Copyright (C) 2013 Red Hat, Inc.
+# Copyright (C) 2020 Red Hat, Inc.
# All rights reserved.
#
# License: GPL (version 3 or any later version).
@@ -55,7 +55,7 @@ my $reportStats = "";
my $dataLocation = "/tmp";
my $startTLSoid = "1.3.6.1.4.1.1466.20037";
my @statnames=qw(last last_str results srch add mod modrdn moddn cmp del abandon
- conns sslconns bind anonbind unbind notesA notesU etime);
+ conns sslconns bind anonbind unbind notesA notesU notesF etime);
my $s_stats;
my $m_stats;
my $verb = "no";
@@ -211,6 +211,7 @@ my $sslClientBindCount = 0;
my $sslClientFailedCount = 0;
my $objectclassTopCount= 0;
my $pagedSearchCount = 0;
+my $invalidFilterCount = 0;
my $bindCount = 0;
my $filterCount = 0;
my $baseCount = 0;
@@ -258,7 +259,7 @@ map {$conn{$_} = $_} @conncodes;
# hash db-backed hashes
my @hashnames = qw(attr rc src rsrc excount conn_hash ip_hash conncount nentries
filter base ds6xbadpwd saslmech saslconnop bindlist etime oid
- start_time_of_connection end_time_of_connection
+ start_time_of_connection end_time_of_connection notesf_conn_op
notesa_conn_op notesu_conn_op etime_conn_op nentries_conn_op
optype_conn_op time_conn_op srch_conn_op del_conn_op mod_conn_op
mdn_conn_op cmp_conn_op bind_conn_op unbind_conn_op ext_conn_op
@@ -926,7 +927,7 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
}
while($op > 0){
# The bind op is not the same as the search op that triggered the notes=A.
- # We have adjust the key by decrementing the op count until we find the last bind op.
+ # We have to adjust the key by decrementing the op count until we find the last bind op.
$op--;
$binddn_key = "$srvRstCnt,$conn,$op";
if (exists($bind_conn_op->{$binddn_key}) && defined($bind_conn_op->{$binddn_key})) {
@@ -1049,9 +1050,60 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
}
}
}
-} # end of unindexed search report
+ print "\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};
+ my $time_conn_op = $hashes->{time_conn_op};
+ my $etime_conn_op = $hashes->{etime_conn_op};
+ my $nentries_conn_op = $hashes->{nentries_conn_op};
+ my $filter_conn_op = $hashes->{filter_conn_op};
+ my $bind_conn_op = $hashes->{bind_conn_op};
+ my $notesCount = 1;
+ my $unindexedIp;
+ my $binddn_key;
+ my %uniqFilt = (); # hash of unique filters
+ my %uniqFilter = (); # hash of unique filters bind dn
+ my %uniqBindDNs = (); # hash of unique bind dn's
+ my %uniqBindFilters = (); # hash of filters for a bind DN
+
+ while (my ($srcnt_conn_op, $count) = each %{$notesf_conn_op}) {
+ my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op);
+ my $attrIp = getIPfromConn($conn, $srvRstCnt);
+ print "\n Invalid Attribute Filter #".$notesCount." (notes=F)\n";
+ print " - Date/Time: $time_conn_op->{$srcnt_conn_op}\n";
+ print " - Connection Number: $conn\n";
+ print " - Operation Number: $op\n";
+ print " - Etime: $etime_conn_op->{$srcnt_conn_op}\n";
+ print " - Nentries: $nentries_conn_op->{$srcnt_conn_op}\n";
+ print " - IP Address: $attrIp\n";
+ if (exists($filter_conn_op->{$srcnt_conn_op}) && defined($filter_conn_op->{$srcnt_conn_op})) {
+ print " - Search Filter: $filter_conn_op->{$srcnt_conn_op}\n";
+ $uniqFilt{$filter_conn_op->{$srcnt_conn_op}}++;
+ }
+ while($op > 0){
+ # The bind op is not the same as the search op that triggered the notes=A.
+ # We have to adjust the key by decrementing the op count until we find the last bind op.
+ $op--;
+ $binddn_key = "$srvRstCnt,$conn,$op";
+ if (exists($bind_conn_op->{$binddn_key}) && defined($bind_conn_op->{$binddn_key})) {
+ print " - Bind DN: $bind_conn_op->{$binddn_key}\n";
+ $uniqBindDNs{$bind_conn_op->{$binddn_key}}++;
+ if( $uniqFilt{$filter_conn_op->{$srcnt_conn_op}} && defined($filter_conn_op->{$srcnt_conn_op})) {
+ $uniqBindFilters{$bind_conn_op->{$binddn_key}}{$filter_conn_op->{$srcnt_conn_op}}++;
+ $uniqFilter{$filter_conn_op->{$srcnt_conn_op}}{$bind_conn_op->{$binddn_key}}++;
+ }
+ last;
+ }
+ }
+ $notesCount++;
+ }
+ print "\n";
+}
-print "\n";
print "FDs Taken: $fdTaken\n";
print "FDs Returned: $fdReturned\n";
print "Highest FD Taken: $highestFdTaken\n\n";
@@ -1386,20 +1438,20 @@ if ($usage =~ /l/ || $verb eq "yes"){
}
}
-#########################################
-# #
-# Gather and Process the unique etimes #
-# #
-#########################################
+##############################################################
+# #
+# Gather and Process the unique etimes, wtimes, and optimes #
+# #
+##############################################################
my $first;
if ($usage =~ /t/i || $verb eq "yes"){
+ # Print the elapsed times (etime)
+
my $etime = $hashes->{etime};
my @ekeys = keys %{$etime};
- #
# print most often etimes
- #
- print "\n\n----- Top $sizeCount Most Frequent etimes -----\n\n";
+ print "\n\n----- Top $sizeCount Most Frequent etimes (elapsed times) -----\n\n";
my $eloop = 0;
my $retime = 0;
foreach my $et (sort { $etime->{$b} <=> $etime->{$a} } @ekeys) {
@@ -1411,16 +1463,84 @@ if ($usage =~ /t/i || $verb eq "yes"){
printf "%-8s %-12s\n", $etime->{ $et }, "etime=$et";
$eloop++;
}
- #
+ if ($eloop == 0) {
+ print "None";
+ }
# print longest etimes
- #
- print "\n\n----- Top $sizeCount Longest etimes -----\n\n";
+ print "\n\n----- Top $sizeCount Longest etimes (elapsed times) -----\n\n";
$eloop = 0;
foreach my $et (sort { $b <=> $a } @ekeys) {
if ($eloop == $sizeCount) { last; }
printf "%-12s %-10s\n","etime=$et",$etime->{ $et };
$eloop++;
}
+ if ($eloop == 0) {
+ print "None";
+ }
+
+ # Print the wait times (wtime)
+
+ my $wtime = $hashes->{wtime};
+ my @wkeys = keys %{$wtime};
+ # print most often wtimes
+ print "\n\n----- Top $sizeCount Most Frequent wtimes (wait times) -----\n\n";
+ $eloop = 0;
+ $retime = 0;
+ foreach my $et (sort { $wtime->{$b} <=> $wtime->{$a} } @wkeys) {
+ if ($eloop == $sizeCount) { last; }
+ if ($retime ne "2"){
+ $first = $et;
+ $retime = "2";
+ }
+ printf "%-8s %-12s\n", $wtime->{ $et }, "wtime=$et";
+ $eloop++;
+ }
+ if ($eloop == 0) {
+ print "None";
+ }
+ # print longest wtimes
+ print "\n\n----- Top $sizeCount Longest wtimes (wait times) -----\n\n";
+ $eloop = 0;
+ foreach my $et (sort { $b <=> $a } @wkeys) {
+ if ($eloop == $sizeCount) { last; }
+ printf "%-12s %-10s\n","wtime=$et",$wtime->{ $et };
+ $eloop++;
+ }
+ if ($eloop == 0) {
+ print "None";
+ }
+
+ # Print the operation times (optime)
+
+ my $optime = $hashes->{optime};
+ my @opkeys = keys %{$optime};
+ # print most often optimes
+ print "\n\n----- Top $sizeCount Most Frequent optimes (actual operation times) -----\n\n";
+ $eloop = 0;
+ $retime = 0;
+ foreach my $et (sort { $optime->{$b} <=> $optime->{$a} } @opkeys) {
+ if ($eloop == $sizeCount) { last; }
+ if ($retime ne "2"){
+ $first = $et;
+ $retime = "2";
+ }
+ printf "%-8s %-12s\n", $optime->{ $et }, "optime=$et";
+ $eloop++;
+ }
+ if ($eloop == 0) {
+ print "None";
+ }
+ # print longest optimes
+ print "\n\n----- Top $sizeCount Longest optimes (actual operation times) -----\n\n";
+ $eloop = 0;
+ foreach my $et (sort { $b <=> $a } @opkeys) {
+ if ($eloop == $sizeCount) { last; }
+ printf "%-12s %-10s\n","optime=$et",$optime->{ $et };
+ $eloop++;
+ }
+ if ($eloop == 0) {
+ print "None";
+ }
}
#######################################
@@ -2152,6 +2272,26 @@ sub parseLineNormal
if (m/ RESULT err=/ && m/ notes=[A-Z,]*P/){
$pagedSearchCount++;
}
+ if (m/ RESULT err=/ && m/ notes=[A-Z,]*F/){
+ $invalidFilterCount++;
+ $con = "";
+ if ($_ =~ /conn= *([0-9A-Z]+)/i){
+ $con = $1;
+ if ($_ =~ /op= *([0-9\-]+)/i){ $op = $1;}
+ }
+
+ if($reportStats){ inc_stats('notesF',$s_stats,$m_stats); }
+ if ($usage =~ /u/ || $usage =~ /U/ || $verb eq "yes"){
+ if($_ =~ /etime= *([0-9.]+)/i ){
+ if($1 >= $minEtime){
+ $hashes->{etime_conn_op}->{"$serverRestartCount,$con,$op"} = $1;
+ $hashes->{notesf_conn_op}->{"$serverRestartCount,$con,$op"}++;
+ if ($_ =~ / *([0-9a-z:\/]+)/i){ $hashes->{time_conn_op}->{"$serverRestartCount,$con,$op"} = $1; }
+ if ($_ =~ /nentries= *([0-9]+)/i ){ $hashes->{nentries_conn_op}->{"$serverRestartCount,$con,$op"} = $1; }
+ }
+ }
+ }
+ }
if (m/ notes=[A-Z,]*A/){
$con = "";
if ($_ =~ /conn= *([0-9A-Z]+)/i){
@@ -2435,6 +2575,16 @@ sub parseLineNormal
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;
+ 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;
+ if ($usage =~ /t/i || $verb eq "yes"){ $hashes->{optime}->{$optime_val}++; }
+ if ($reportStats){ inc_stats_val('optime',$optime_val,$s_stats,$m_stats); }
+ }
if ($_ =~ / tag=101 / || $_ =~ / tag=111 / || $_ =~ / tag=100 / || $_ =~ / tag=115 /){
if ($_ =~ / nentries= *([0-9]+)/i ){
my $nents = $1;
@@ -2555,7 +2705,7 @@ sub parseLineNormal
}
}
}
- if (/ RESULT err=/ && / tag=97 nentries=0 etime=/ && $_ =~ /dn=\"(.*)\"/i){
+ if (/ RESULT err=/ && / tag=97 nentries=0 / && $_ =~ /dn=\"(.*)\"/i){
# Check if this is a sasl bind, if see we need to add the RESULT's dn as a bind dn
my $binddn = $1;
my ($conn, $op);
@@ -2680,6 +2830,7 @@ print_stats_block
$stats->{'unbind'},
$stats->{'notesA'},
$stats->{'notesU'},
+ $stats->{'notesF'},
$stats->{'etime'}),
"\n" );
} else {
diff --git a/ldap/servers/slapd/add.c b/ldap/servers/slapd/add.c
index 06ca1ee..52c64fa 100644
--- a/ldap/servers/slapd/add.c
+++ b/ldap/servers/slapd/add.c
@@ -441,6 +441,9 @@ op_shared_add(Slapi_PBlock *pb)
internal_op = operation_is_flag_set(operation, OP_FLAG_INTERNAL);
pwpolicy = new_passwdPolicy(pb, slapi_entry_get_dn(e));
+ /* Set the time we actually started the operation */
+ slapi_operation_set_time_started(operation);
+
/* target spec is used to decide which plugins are applicable for the operation */
operation_set_target_spec(operation, slapi_entry_get_sdn(e));
diff --git a/ldap/servers/slapd/bind.c b/ldap/servers/slapd/bind.c
index 310216e..55f8650 100644
--- a/ldap/servers/slapd/bind.c
+++ b/ldap/servers/slapd/bind.c
@@ -87,6 +87,10 @@ do_bind(Slapi_PBlock *pb)
send_ldap_result(pb, LDAP_OPERATIONS_ERROR, NULL, NULL, 0, NULL);
goto free_and_return;
}
+
+ /* Set the time we actually started the operation */
+ slapi_operation_set_time_started(pb_op);
+
ber = pb_op->o_ber;
/*
diff --git a/ldap/servers/slapd/delete.c b/ldap/servers/slapd/delete.c
index c0e61ad..1a72093 100644
--- a/ldap/servers/slapd/delete.c
+++ b/ldap/servers/slapd/delete.c
@@ -236,6 +236,9 @@ op_shared_delete(Slapi_PBlock *pb)
slapi_pblock_get(pb, SLAPI_OPERATION, &operation);
internal_op = operation_is_flag_set(operation, OP_FLAG_INTERNAL);
+ /* Set the time we actually started the operation */
+ slapi_operation_set_time_started(operation);
+
sdn = slapi_sdn_new_dn_byval(rawdn);
dn = slapi_sdn_get_dn(sdn);
slapi_pblock_set(pb, SLAPI_DELETE_TARGET_SDN, (void *)sdn);
diff --git a/ldap/servers/slapd/modify.c b/ldap/servers/slapd/modify.c
index 259bedf..a186dbd 100644
--- a/ldap/servers/slapd/modify.c
+++ b/ldap/servers/slapd/modify.c
@@ -626,6 +626,9 @@ op_shared_modify(Slapi_PBlock *pb, int pw_change, char *old_pw)
slapi_pblock_get(pb, SLAPI_SKIP_MODIFIED_ATTRS, &skip_modified_attrs);
slapi_pblock_get(pb, SLAPI_CONNECTION, &pb_conn);
+ /* Set the time we actually started the operation */
+ slapi_operation_set_time_started(operation);
+
if (sdn) {
passin_sdn = 1;
} else {
diff --git a/ldap/servers/slapd/modrdn.c b/ldap/servers/slapd/modrdn.c
index 3efe584..e04916b 100644
--- a/ldap/servers/slapd/modrdn.c
+++ b/ldap/servers/slapd/modrdn.c
@@ -417,6 +417,9 @@ op_shared_rename(Slapi_PBlock *pb, int passin_args)
internal_op = operation_is_flag_set(operation, OP_FLAG_INTERNAL);
slapi_pblock_get(pb, SLAPI_CONNECTION, &pb_conn);
+ /* Set the time we actually started the operation */
+ slapi_operation_set_time_started(operation);
+
/*
* If ownership has not been passed to this function, we replace the
* string input fields within the pblock with strdup'd copies. Why?
diff --git a/ldap/servers/slapd/operation.c b/ldap/servers/slapd/operation.c
index ff16cd9..4dd3481 100644
--- a/ldap/servers/slapd/operation.c
+++ b/ldap/servers/slapd/operation.c
@@ -651,3 +651,27 @@ slapi_operation_time_expiry(Slapi_Operation *o, time_t timeout, struct timespec
{
slapi_timespec_expire_rel(timeout, &(o->o_hr_time_rel), expiry);
}
+
+/* Set the time the operation actually started */
+void
+slapi_operation_set_time_started(Slapi_Operation *o)
+{
+ clock_gettime(CLOCK_MONOTONIC, &(o->o_hr_time_started_rel));
+}
+
+/* The time diff of how long the operation took once it actually started */
+void
+slapi_operation_op_time_elapsed(Slapi_Operation *o, struct timespec *elapsed)
+{
+ struct timespec o_hr_time_now;
+ clock_gettime(CLOCK_MONOTONIC, &o_hr_time_now);
+
+ slapi_timespec_diff(&o_hr_time_now, &(o->o_hr_time_started_rel), elapsed);
+}
+
+/* The time diff the operation waited in the work queue */
+void
+slapi_operation_workq_time_elapsed(Slapi_Operation *o, struct timespec *elapsed)
+{
+ slapi_timespec_diff(&(o->o_hr_time_started_rel), &(o->o_hr_time_rel), elapsed);
+}
diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c
index 9fe7865..c0bc5dc 100644
--- a/ldap/servers/slapd/opshared.c
+++ b/ldap/servers/slapd/opshared.c
@@ -284,6 +284,9 @@ op_shared_search(Slapi_PBlock *pb, int send_result)
slapi_pblock_get(pb, SLAPI_SEARCH_TARGET_SDN, &sdn);
slapi_pblock_get(pb, SLAPI_OPERATION, &operation);
+ /* Set the time we actually started the operation */
+ slapi_operation_set_time_started(operation);
+
if (NULL == sdn) {
sdn = slapi_sdn_new_dn_byval(base);
slapi_pblock_set(pb, SLAPI_SEARCH_TARGET_SDN, sdn);
diff --git a/ldap/servers/slapd/result.c b/ldap/servers/slapd/result.c
index 0b13c30..61efb6f 100644
--- a/ldap/servers/slapd/result.c
+++ b/ldap/servers/slapd/result.c
@@ -1975,6 +1975,8 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
CSN *operationcsn = NULL;
char csn_str[CSN_STRSIZE + 5];
char etime[ETIME_BUFSIZ] = {0};
+ char wtime[ETIME_BUFSIZ] = {0};
+ char optime[ETIME_BUFSIZ] = {0};
int pr_idx = -1;
int pr_cookie = -1;
uint32_t operation_notes;
@@ -1982,19 +1984,26 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
int32_t op_id;
int32_t op_internal_id;
int32_t op_nested_count;
+ struct timespec o_hr_time_end;
get_internal_conn_op(&connid, &op_id, &op_internal_id, &op_nested_count);
-
slapi_pblock_get(pb, SLAPI_PAGED_RESULTS_INDEX, &pr_idx);
slapi_pblock_get(pb, SLAPI_PAGED_RESULTS_COOKIE, &pr_cookie);
-
internal_op = operation_is_flag_set(op, OP_FLAG_INTERNAL);
- struct timespec o_hr_time_end;
+ /* total elapsed time */
slapi_operation_time_elapsed(op, &o_hr_time_end);
+ snprintf(etime, ETIME_BUFSIZ, "%" PRId64 ".%.09" PRId64 "", (int64_t)o_hr_time_end.tv_sec, (int64_t)o_hr_time_end.tv_nsec);
+
+ /* wait time */
+ slapi_operation_workq_time_elapsed(op, &o_hr_time_end);
+ snprintf(wtime, ETIME_BUFSIZ, "%" PRId64 ".%.09" PRId64 "", (int64_t)o_hr_time_end.tv_sec, (int64_t)o_hr_time_end.tv_nsec);
+
+ /* op time */
+ slapi_operation_op_time_elapsed(op, &o_hr_time_end);
+ snprintf(optime, ETIME_BUFSIZ, "%" PRId64 ".%.09" PRId64 "", (int64_t)o_hr_time_end.tv_sec, (int64_t)o_hr_time_end.tv_nsec);
- snprintf(etime, ETIME_BUFSIZ, "%" PRId64 ".%.09" PRId64 "", (int64_t)o_hr_time_end.tv_sec, (int64_t)o_hr_time_end.tv_nsec);
operation_notes = slapi_pblock_get_operation_notes(pb);
@@ -2025,16 +2034,16 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
if (!internal_op) {
slapi_log_access(LDAP_DEBUG_STATS,
"conn=%" PRIu64 " op=%d RESULT err=%d"
- " tag=%" BERTAG_T " nentries=%d etime=%s%s%s"
+ " tag=%" BERTAG_T " nentries=%d wtime=%s optime=%s etime=%s%s%s"
", SASL bind in progress\n",
op->o_connid,
op->o_opid,
err, tag, nentries,
- etime,
+ wtime, optime, etime,
notes_str, csn_str);
} else {
-#define LOG_SASLMSG_FMT " tag=%" BERTAG_T " nentries=%d etime=%s%s%s, SASL bind in progress\n"
+#define LOG_SASLMSG_FMT " tag=%" BERTAG_T " nentries=%d wtime=%s optime=%s etime=%s%s%s, SASL bind in progress\n"
slapi_log_access(LDAP_DEBUG_ARGS,
connid == 0 ? LOG_CONN_OP_FMT_INT_INT LOG_SASLMSG_FMT :
LOG_CONN_OP_FMT_EXT_INT LOG_SASLMSG_FMT,
@@ -2043,7 +2052,7 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
op_internal_id,
op_nested_count,
err, tag, nentries,
- etime,
+ wtime, optime, etime,
notes_str, csn_str);
}
} else if (op->o_tag == LDAP_REQ_BIND && err == LDAP_SUCCESS) {
@@ -2057,15 +2066,15 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
if (!internal_op) {
slapi_log_access(LDAP_DEBUG_STATS,
"conn=%" PRIu64 " op=%d RESULT err=%d"
- " tag=%" BERTAG_T " nentries=%d etime=%s%s%s"
+ " tag=%" BERTAG_T " nentries=%d wtime=%s optime=%s etime=%s%s%s"
" dn=\"%s\"\n",
op->o_connid,
op->o_opid,
err, tag, nentries,
- etime,
+ wtime, optime, etime,
notes_str, csn_str, dn ? dn : "");
} else {
-#define LOG_BINDMSG_FMT " tag=%" BERTAG_T " nentries=%d etime=%s%s%s dn=\"%s\"\n"
+#define LOG_BINDMSG_FMT " tag=%" BERTAG_T " nentries=%d wtime=%s optime=%s etime=%s%s%s dn=\"%s\"\n"
slapi_log_access(LDAP_DEBUG_ARGS,
connid == 0 ? LOG_CONN_OP_FMT_INT_INT LOG_BINDMSG_FMT :
LOG_CONN_OP_FMT_EXT_INT LOG_BINDMSG_FMT,
@@ -2074,7 +2083,7 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
op_internal_id,
op_nested_count,
err, tag, nentries,
- etime,
+ wtime, optime, etime,
notes_str, csn_str, dn ? dn : "");
}
slapi_ch_free((void **)&dn);
@@ -2083,15 +2092,15 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
if (!internal_op) {
slapi_log_access(LDAP_DEBUG_STATS,
"conn=%" PRIu64 " op=%d RESULT err=%d"
- " tag=%" BERTAG_T " nentries=%d etime=%s%s%s"
+ " tag=%" BERTAG_T " nentries=%d wtime=%s optime=%s etime=%s%s%s"
" pr_idx=%d pr_cookie=%d\n",
op->o_connid,
op->o_opid,
err, tag, nentries,
- etime,
+ wtime, optime, etime,
notes_str, csn_str, pr_idx, pr_cookie);
} else {
-#define LOG_PRMSG_FMT " tag=%" BERTAG_T " nentries=%d etime=%s%s%s pr_idx=%d pr_cookie=%d \n"
+#define LOG_PRMSG_FMT " tag=%" BERTAG_T " nentries=%d wtime=%s optime=%s etime=%s%s%s pr_idx=%d pr_cookie=%d \n"
slapi_log_access(LDAP_DEBUG_ARGS,
connid == 0 ? LOG_CONN_OP_FMT_INT_INT LOG_PRMSG_FMT :
LOG_CONN_OP_FMT_EXT_INT LOG_PRMSG_FMT,
@@ -2100,7 +2109,7 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
op_internal_id,
op_nested_count,
err, tag, nentries,
- etime,
+ wtime, optime, etime,
notes_str, csn_str, pr_idx, pr_cookie);
}
} else if (!internal_op) {
@@ -2114,11 +2123,11 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
}
slapi_log_access(LDAP_DEBUG_STATS,
"conn=%" PRIu64 " op=%d RESULT err=%d"
- " tag=%" BERTAG_T " nentries=%d etime=%s%s%s%s\n",
+ " tag=%" BERTAG_T " nentries=%d wtime=%s optime=%s etime=%s%s%s%s\n",
op->o_connid,
op->o_opid,
err, tag, nentries,
- etime,
+ wtime, optime, etime,
notes_str, csn_str, ext_str);
if (pbtxt) {
/* if !pbtxt ==> ext_str == "". Don't free ext_str. */
@@ -2126,7 +2135,7 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
}
} else {
int optype;
-#define LOG_MSG_FMT " tag=%" BERTAG_T " nentries=%d etime=%s%s%s\n"
+#define LOG_MSG_FMT " tag=%" BERTAG_T " nentries=%d wtime=%s optime=%s etime=%s%s%s\n"
slapi_log_access(LDAP_DEBUG_ARGS,
connid == 0 ? LOG_CONN_OP_FMT_INT_INT LOG_MSG_FMT :
LOG_CONN_OP_FMT_EXT_INT LOG_MSG_FMT,
@@ -2135,7 +2144,7 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
op_internal_id,
op_nested_count,
err, tag, nentries,
- etime,
+ wtime, optime, etime,
notes_str, csn_str);
/*
* If this is an unindexed search we should log it in the error log if
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
index 7e0fa61..894efd2 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -1541,16 +1541,17 @@ typedef struct slapi_operation_results
*/
typedef struct op
{
- BerElement *o_ber; /* ber of the request */
- ber_int_t o_msgid; /* msgid of the request */
- ber_tag_t o_tag; /* tag of the request */
+ BerElement *o_ber; /* ber of the request */
+ ber_int_t o_msgid; /* msgid of the request */
+ ber_tag_t o_tag; /* tag of the request */
struct timespec o_hr_time_rel; /* internal system time op initiated */
struct timespec o_hr_time_utc; /* utc system time op initiated */
- int o_isroot; /* requestor is manager */
+ struct timespec o_hr_time_started_rel; /* internal system time op started */
+ int o_isroot; /* requestor is manager */
Slapi_DN o_sdn; /* dn bound when op was initiated */
- char *o_authtype; /* auth method used to bind dn */
+ char *o_authtype; /* auth method used to bind dn */
int o_ssf; /* ssf for this operation (highest between SASL and TLS/SSL) */
- int o_opid; /* id of this operation */
+ int o_opid; /* id of this operation */
PRUint64 o_connid; /* id of conn initiating this op; for logging only */
void *o_handler_data;
result_handler o_result_handler;
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index d6a42af..be6c98b 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -8218,13 +8218,29 @@ void slapi_operation_time_elapsed(Slapi_Operation *o, struct timespec *elapsed);
*/
void slapi_operation_time_initiated(Slapi_Operation *o, struct timespec *initiated);
/**
- * Given an operation and a timeout, return a populate struct with the expiry
- * time of the operation suitable for checking with slapi_timespec_expire_check
+ * Given an operation, determine the time elapsed since the op
+ * was actually started.
*
- * \param Slapi_Operation o - the operation that is in progress
- * \param time_t timeout the seconds relative to operation initiation to expiry at.
- * \param struct timespec *expiry the timespec to popluate with the relative expiry.
+ * \param Slapi_Operation o - the operation which is inprogress
+ * \param struct timespec *elapsed - location where the time difference will be
+ * placed.
+ */
+void slapi_operation_op_time_elapsed(Slapi_Operation *o, struct timespec *elapsed);
+/**
+ * Given an operation, determine the time elapsed that the op spent
+ * in the work queue before actually being dispatched to a worker thread
+ *
+ * \param Slapi_Operation o - the operation which is inprogress
+ * \param struct timespec *elapsed - location where the time difference will be
+ * placed.
+ */
+void slapi_operation_workq_time_elapsed(Slapi_Operation *o, struct timespec *elapsed);
+/**
+ * Set the time the operation actually started
+ *
+ * \param Slapi_Operation o - the operation which is inprogress
*/
+void slapi_operation_set_time_started(Slapi_Operation *o);
#endif
/**
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 3 months
[389-ds-base] branch 389-ds-base-1.4.2 updated: Issue 51169 - UI - attr uniqueness - selecting empty subtree crashes cockpit
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.2
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.2 by this push:
new fde7a55 Issue 51169 - UI - attr uniqueness - selecting empty subtree crashes cockpit
fde7a55 is described below
commit fde7a55d16322f14b8caa458f551d1b61dc7047f
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Mon Jun 22 12:44:49 2020 -0400
Issue 51169 - UI - attr uniqueness - selecting empty subtree crashes cockpit
Description: When processing the typeAheadChange we need to check for a empty
string before treating the array like a list of objects.
Also updated README with contribution instructions
relates: https://pagure.io/389-ds-base/issue/51169
Reviewed by: spichugi(Thanks!)
Improve handling of typeAhead values.
In some cases its an array of strings, and in some cases it's array of objects
---
src/cockpit/389-console/README.md | 67 +++++-----------------
src/cockpit/389-console/buildAndRun.sh | 1 +
.../src/lib/plugins/attributeUniqueness.jsx | 7 ++-
3 files changed, 22 insertions(+), 53 deletions(-)
diff --git a/src/cockpit/389-console/README.md b/src/cockpit/389-console/README.md
index 290160a..95648da 100644
--- a/src/cockpit/389-console/README.md
+++ b/src/cockpit/389-console/README.md
@@ -8,7 +8,6 @@ title: "Cockpit UI Design"
The main layout consists of as tabbed panel for the following categories:
- Server Configuration
-- Security
- Database
- Replication
- Schema
@@ -30,17 +29,12 @@ This is the welcome page(panel). You select which local instance you want to co
- General Configuration: port, hostname, LDAPI, various config settings under cn=config
- SASL: SSL Settings and Mappings
+- Security: Managed security settings and certificates
- Password Policy: all things password related
- Logs: access, error, audit/auditfail settings
- Tasks: backups/restore, Create/delete instances, etc
- Tuning and resource limits: size/time limits, max threads per conn, etc
-## Security
-
-- Enable Security and configuration settings
-- Manage Certificate Database
-- Manage ciphers
-
## Database
- Mapping tree and backend are "linked". They are seen as a single object in the UI. If you create a new suffix, it creates the mapping tree entry and the backend entry. Delete removes both as well.
@@ -53,7 +47,7 @@ This is the welcome page(panel). You select which local instance you want to co
- Referrals
- Indexes
- Attr encryption
-- Suffix Tree Node - right click:
+- Suffix Tree Node - right click:
- Import/Export
- Backup/Restore
- Reindex
@@ -64,9 +58,9 @@ This is the welcome page(panel). You select which local instance you want to co
## Replication
-Setup replication configuration, changelog, and agreements. Keep agmt setup wizard simple. Build in some simple monitoring and agreement status info. Save the real replication monitoring for the monitor tab panel.
+Setup replication configuration, changelog, and agreements. Keep agmt setup wizard simple. Build in some simple monitoring and agreement status info. Save the real replication monitoring for the monitor tab panel.
-- Build in cleanallruv task (and the abort task), and cleanallruv task monitoring!
+- Build in cleanallruv task (and the abort task), and cleanallruv task monitoring
- "Reinit all agmts" option??
- "test replication" operation (already exists in lib389) - monitoring page, or agreement dropdown(+1)?
@@ -161,53 +155,22 @@ List:
"items": []
}
-# Misc
----------------------
-
-No RESET buttons? Not yet at least...
-
-
-LIB389 Requirements:
-
-- Consistent JSON representation of entries
-- Retrieve schema: standard and custom (user-defined)
-- Retrieve plugins
-- Get attr syntaxes
-- retreive indexes
-- Retreive config (cn=config and friends)
-- SASL mapping/priority
-- Retrieve cleanAllRUV(and abort) tasks
-- Get all user/subtree password policies
-- Get SSL ciphers
-- Get certificates:
- - Get Trust Attrs
- - Get CA certs: expireation dates
- - Get Server Certs, exp dates, issue to, issued by
- - Get Revoked Certs: isssued by, effective date, Next Update, Type
-
-
-
-
-# To Do
--------------------------------------
-
-## wizard forms(modals)
-
-- Edit plugin (generic)
-- Edit plugin (RI plugin)
-- Edit plugin (Member Of)
-- Edit plugin ...
-- Add/edit SASL Mapiing
-- Import/Export Certification (file location)
-- All the cert stuff
-
-
-
+# Contributing
+-------------------------
+To test changes to the 389-console plugin, you can set up links from your workspace to a user's home directory
+- Create cockpit directory under user's home directory
+ mkdir ~/.local/share/cockpit/389-console
+- Link your workspace directory
+ ln -s /home/USERNAME/source/389-ds-base/src/cockpit/389-console/dist ~/.local/share/cockpit/389-console
+- Then run the build & watch script. This builds the UI and "watches" it for changes
+ cd /home/USERNAME/source/389-ds-base/src/cockpit/389-console/
+ ./buildAndRun.sh
+- All changes to the source code will be reflected in the UI without having to reinstall any packages. You just need to reload the browser to see the changes.
diff --git a/src/cockpit/389-console/buildAndRun.sh b/src/cockpit/389-console/buildAndRun.sh
index 8021003..790741c 100755
--- a/src/cockpit/389-console/buildAndRun.sh
+++ b/src/cockpit/389-console/buildAndRun.sh
@@ -27,6 +27,7 @@ while (( "$#" )); do
done
printf "\nCleaning and installing npm packages ...\n\n"
+rm -rf dist/*
make -f node_modules.mk clean > /dev/null
make -f node_modules.mk install > /dev/null
if [ $? != 0 ]; then
diff --git a/src/cockpit/389-console/src/lib/plugins/attributeUniqueness.jsx b/src/cockpit/389-console/src/lib/plugins/attributeUniqueness.jsx
index af25ebb..12702aa 100644
--- a/src/cockpit/389-console/src/lib/plugins/attributeUniqueness.jsx
+++ b/src/cockpit/389-console/src/lib/plugins/attributeUniqueness.jsx
@@ -96,7 +96,12 @@ class AttributeUniqueness extends React.Component {
// instead of string. Grab the "label" in this case
let new_values = [];
for (let val of values) {
- new_values.push(val.label);
+ if (val != "") {
+ if (typeof val === 'object') {
+ val = val.label;
+ }
+ new_values.push(val);
+ }
}
this.setState({
subtrees: new_values
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 3 months
[389-ds-base] branch 389-ds-base-1.4.3 updated: Issue 51169 - UI - attr uniqueness - selecting empty subtree crashes cockpit
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.3
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.3 by this push:
new 0e28409 Issue 51169 - UI - attr uniqueness - selecting empty subtree crashes cockpit
0e28409 is described below
commit 0e284098bdce3027f102364f5813ccd93f9a0b47
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Mon Jun 22 12:44:49 2020 -0400
Issue 51169 - UI - attr uniqueness - selecting empty subtree crashes cockpit
Description: When processing the typeAheadChange we need to check for a empty
string before treating the array like a list of objects.
Also updated README with contribution instructions
relates: https://pagure.io/389-ds-base/issue/51169
Reviewed by: spichugi(Thanks!)
Improve handling of typeAhead values.
In some cases its an array of strings, and in some cases it's array of objects
---
src/cockpit/389-console/README.md | 67 +++++-----------------
src/cockpit/389-console/buildAndRun.sh | 1 +
.../src/lib/plugins/attributeUniqueness.jsx | 7 ++-
3 files changed, 22 insertions(+), 53 deletions(-)
diff --git a/src/cockpit/389-console/README.md b/src/cockpit/389-console/README.md
index 290160a..95648da 100644
--- a/src/cockpit/389-console/README.md
+++ b/src/cockpit/389-console/README.md
@@ -8,7 +8,6 @@ title: "Cockpit UI Design"
The main layout consists of as tabbed panel for the following categories:
- Server Configuration
-- Security
- Database
- Replication
- Schema
@@ -30,17 +29,12 @@ This is the welcome page(panel). You select which local instance you want to co
- General Configuration: port, hostname, LDAPI, various config settings under cn=config
- SASL: SSL Settings and Mappings
+- Security: Managed security settings and certificates
- Password Policy: all things password related
- Logs: access, error, audit/auditfail settings
- Tasks: backups/restore, Create/delete instances, etc
- Tuning and resource limits: size/time limits, max threads per conn, etc
-## Security
-
-- Enable Security and configuration settings
-- Manage Certificate Database
-- Manage ciphers
-
## Database
- Mapping tree and backend are "linked". They are seen as a single object in the UI. If you create a new suffix, it creates the mapping tree entry and the backend entry. Delete removes both as well.
@@ -53,7 +47,7 @@ This is the welcome page(panel). You select which local instance you want to co
- Referrals
- Indexes
- Attr encryption
-- Suffix Tree Node - right click:
+- Suffix Tree Node - right click:
- Import/Export
- Backup/Restore
- Reindex
@@ -64,9 +58,9 @@ This is the welcome page(panel). You select which local instance you want to co
## Replication
-Setup replication configuration, changelog, and agreements. Keep agmt setup wizard simple. Build in some simple monitoring and agreement status info. Save the real replication monitoring for the monitor tab panel.
+Setup replication configuration, changelog, and agreements. Keep agmt setup wizard simple. Build in some simple monitoring and agreement status info. Save the real replication monitoring for the monitor tab panel.
-- Build in cleanallruv task (and the abort task), and cleanallruv task monitoring!
+- Build in cleanallruv task (and the abort task), and cleanallruv task monitoring
- "Reinit all agmts" option??
- "test replication" operation (already exists in lib389) - monitoring page, or agreement dropdown(+1)?
@@ -161,53 +155,22 @@ List:
"items": []
}
-# Misc
----------------------
-
-No RESET buttons? Not yet at least...
-
-
-LIB389 Requirements:
-
-- Consistent JSON representation of entries
-- Retrieve schema: standard and custom (user-defined)
-- Retrieve plugins
-- Get attr syntaxes
-- retreive indexes
-- Retreive config (cn=config and friends)
-- SASL mapping/priority
-- Retrieve cleanAllRUV(and abort) tasks
-- Get all user/subtree password policies
-- Get SSL ciphers
-- Get certificates:
- - Get Trust Attrs
- - Get CA certs: expireation dates
- - Get Server Certs, exp dates, issue to, issued by
- - Get Revoked Certs: isssued by, effective date, Next Update, Type
-
-
-
-
-# To Do
--------------------------------------
-
-## wizard forms(modals)
-
-- Edit plugin (generic)
-- Edit plugin (RI plugin)
-- Edit plugin (Member Of)
-- Edit plugin ...
-- Add/edit SASL Mapiing
-- Import/Export Certification (file location)
-- All the cert stuff
-
-
-
+# Contributing
+-------------------------
+To test changes to the 389-console plugin, you can set up links from your workspace to a user's home directory
+- Create cockpit directory under user's home directory
+ mkdir ~/.local/share/cockpit/389-console
+- Link your workspace directory
+ ln -s /home/USERNAME/source/389-ds-base/src/cockpit/389-console/dist ~/.local/share/cockpit/389-console
+- Then run the build & watch script. This builds the UI and "watches" it for changes
+ cd /home/USERNAME/source/389-ds-base/src/cockpit/389-console/
+ ./buildAndRun.sh
+- All changes to the source code will be reflected in the UI without having to reinstall any packages. You just need to reload the browser to see the changes.
diff --git a/src/cockpit/389-console/buildAndRun.sh b/src/cockpit/389-console/buildAndRun.sh
index 8021003..790741c 100755
--- a/src/cockpit/389-console/buildAndRun.sh
+++ b/src/cockpit/389-console/buildAndRun.sh
@@ -27,6 +27,7 @@ while (( "$#" )); do
done
printf "\nCleaning and installing npm packages ...\n\n"
+rm -rf dist/*
make -f node_modules.mk clean > /dev/null
make -f node_modules.mk install > /dev/null
if [ $? != 0 ]; then
diff --git a/src/cockpit/389-console/src/lib/plugins/attributeUniqueness.jsx b/src/cockpit/389-console/src/lib/plugins/attributeUniqueness.jsx
index af25ebb..12702aa 100644
--- a/src/cockpit/389-console/src/lib/plugins/attributeUniqueness.jsx
+++ b/src/cockpit/389-console/src/lib/plugins/attributeUniqueness.jsx
@@ -96,7 +96,12 @@ class AttributeUniqueness extends React.Component {
// instead of string. Grab the "label" in this case
let new_values = [];
for (let val of values) {
- new_values.push(val.label);
+ if (val != "") {
+ if (typeof val === 'object') {
+ val = val.label;
+ }
+ new_values.push(val);
+ }
}
this.setState({
subtrees: new_values
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 3 months
[389-ds-base] branch 389-ds-base-1.4.2 updated: Issue 49256 - log warning when thread number is very different from autotuned value
by pagure@pagure.io
This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.2
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.2 by this push:
new bcb79d9 Issue 49256 - log warning when thread number is very different from autotuned value
bcb79d9 is described below
commit bcb79d93bb3112d66cab193350712aae51a2e663
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Mon Jun 22 17:49:10 2020 -0400
Issue 49256 - log warning when thread number is very different from autotuned value
Description: To help prevent customers from setting incorrect values for
the thread number it would be useful to warn them that the
configured value is either way too low or way too high.
relates: https://pagure.io/389-ds-base/issue/49256
Reviewed by: firstyear(Thanks!)
---
dirsrvtests/tests/suites/config/autotuning_test.py | 28 ++++++++++++++++++
ldap/servers/slapd/libglobs.c | 34 +++++++++++++++++++++-
ldap/servers/slapd/slap.h | 3 ++
ldap/servers/slapd/util.c | 3 --
4 files changed, 64 insertions(+), 4 deletions(-)
diff --git a/dirsrvtests/tests/suites/config/autotuning_test.py b/dirsrvtests/tests/suites/config/autotuning_test.py
index d1c7514..5407612 100644
--- a/dirsrvtests/tests/suites/config/autotuning_test.py
+++ b/dirsrvtests/tests/suites/config/autotuning_test.py
@@ -43,6 +43,34 @@ def test_threads_basic(topo):
assert topo.standalone.config.get_attr_val_int("nsslapd-threadnumber") > 0
+def test_threads_warning(topo):
+ """Check that we log a warning if the thread number is too high or low
+
+ :id: db92412b-2812-49de-84b0-00f452cd254f
+ :setup: Standalone Instance
+ :steps:
+ 1. Get autotuned thread number
+ 2. Set threads way higher than hw threads, and find a warning in the log
+ 3. Set threads way lower than hw threads, and find a warning in the log
+ :expectedresults:
+ 1. Success
+ 2. Success
+ 3. Success
+ """
+ topo.standalone.config.set("nsslapd-threadnumber", "-1")
+ autotuned_value = topo.standalone.config.get_attr_val_utf8("nsslapd-threadnumber")
+
+ topo.standalone.config.set("nsslapd-threadnumber", str(int(autotuned_value) * 4))
+ time.sleep(.5)
+ assert topo.standalone.ds_error_log.match('.*higher.*hurt server performance.*')
+
+ if int(autotuned_value) > 1:
+ # If autotuned is 1, there isn't anything to test here
+ topo.standalone.config.set("nsslapd-threadnumber", "1")
+ time.sleep(.5)
+ assert topo.standalone.ds_error_log.match('.*lower.*hurt server performance.*')
+
+
@pytest.mark.parametrize("invalid_value", ('-2', '0', 'invalid'))
def test_threads_invalid_value(topo, invalid_value):
"""Check nsslapd-threadnumber for an invalid values
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c
index 3542e3f..d9225a3 100644
--- a/ldap/servers/slapd/libglobs.c
+++ b/ldap/servers/slapd/libglobs.c
@@ -4324,6 +4324,7 @@ config_set_threadnumber(const char *attrname, char *value, char *errorbuf, int a
{
int retVal = LDAP_SUCCESS;
int32_t threadnum = 0;
+ int32_t hw_threadnum = 0;
char *endp = NULL;
slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
@@ -4336,8 +4337,39 @@ config_set_threadnumber(const char *attrname, char *value, char *errorbuf, int a
threadnum = strtol(value, &endp, 10);
/* Means we want to re-run the hardware detection. */
+ hw_threadnum = util_get_hardware_threads();
if (threadnum == -1) {
- threadnum = util_get_hardware_threads();
+ threadnum = hw_threadnum;
+ } else {
+ /*
+ * Log a message if the user defined thread number is very different
+ * from the hardware threads as this is probably not the optimal
+ * value.
+ */
+ if (threadnum >= hw_threadnum) {
+ if (threadnum > MIN_THREADS && threadnum / hw_threadnum >= 4) {
+ /* We're over the default minimum and way higher than the hw
+ * threads. */
+ slapi_log_err(SLAPI_LOG_NOTICE, "config_set_threadnumber",
+ "The configured thread number (%d) is significantly "
+ "higher than the number of hardware threads (%d). "
+ "This can potentially hurt server performance. If "
+ "you are unsure how to tune \"nsslapd-threadnumber\" "
+ "then set it to \"-1\" and the server will tune it "
+ "according to the system hardware\n",
+ threadnum, hw_threadnum);
+ }
+ } else if (threadnum < MIN_THREADS) {
+ /* The thread number should never be less than the minimum and
+ * hardware threads. */
+ slapi_log_err(SLAPI_LOG_WARNING, "config_set_threadnumber",
+ "The configured thread number (%d) is lower than the number "
+ "of hardware threads (%d). This will hurt server performance. "
+ "If you are unsure how to tune \"nsslapd-threadnumber\" then "
+ "set it to \"-1\" and the server will tune it according to the "
+ "system hardware\n",
+ threadnum, hw_threadnum);
+ }
}
if (*endp != '\0' || errno == ERANGE || threadnum < 1 || threadnum > 65535) {
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
index 7ef9460..65c7560 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -401,6 +401,9 @@ typedef void (*VFPV)(); /* takes undefined arguments */
#define SLAPD_DEFAULT_PW_MAX_CLASS_CHARS_ATTRIBUTE 0
#define SLAPD_DEFAULT_PW_MAX_CLASS_CHARS_ATTRIBUTE_STR "0"
+#define MIN_THREADS 16
+#define MAX_THREADS 512
+
/* Default password values. */
diff --git a/ldap/servers/slapd/util.c b/ldap/servers/slapd/util.c
index 442a83b..7b43d88 100644
--- a/ldap/servers/slapd/util.c
+++ b/ldap/servers/slapd/util.c
@@ -41,9 +41,6 @@
#define FILTER_BUF 128 /* initial buffer size for attr value */
#define BUF_INCR 16 /* the amount to increase the FILTER_BUF once it fills up */
-#define MIN_THREADS 16
-#define MAX_THREADS 512
-
/* slapi-private contains the pal. */
#include <slapi-private.h>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
3 years, 3 months