summaryrefslogtreecommitdiff
path: root/script/attr_count_read
Commit message (Collapse)AuthorAgeFilesLines
* python: Remove unnecessary 'pass' statementsJoseph Sutton2022-05-101-1/+0
| | | | Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
* python: remove all 'from __future__ import print_function'Douglas Bagnall2021-04-281-1/+0
| | | | | | | | | | | | | | | | This made Python 2's print behave like Python 3's print(). In some cases, where we had: from __future__ import print_function """Intended module documentation...""" this will have the side effect of making the intended module documentation work as the actual module documentation (i.e. becoming __doc__), because it is once again the first statement in the module. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* script/attr_count_read: load and correlate all dataDouglas Bagnall2019-05-011-11/+183
| | | | | | | | | | | | | | | | | | | | | | | This changes script/attr_count_read to take the samba private directory as an argument and load all the databases at once, printing them as one big table. It isn't extremely clear what it all means, but it *tries* to tell you. With --plot, it will attempt to load matplotlib and plot the number of requested attributes against the number returned, with colour of each point indicating its relative frequency. It is a scatterplot that wants to be a heatmap. With --no-casefold, you can get an extra confusing table where, for instance, something repeatedly asks for "attributeId" which is not accounted for, while in a completely different row an unrequested "attributeID" is found many times over. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed May 1 06:46:36 UTC 2019 on sn-devel-184
* dsdb/modules: a module to count attribute searches and resultsDouglas Bagnall2019-05-011-0/+27
The dsdb module stack can turn a simple search request into a complicated tree of sub-queries that include attributes not originally asked for and excluding those that were. The corresponding replies might contain unrequested attributes or (for good reasons, according to some module) hide requested ones. The entire stack is there to meddle and that is what is does. Except *this* module. It just counts. To understand dsdb performance it helps to have some idea what requests and replies are flying too and fro. This module, when inserted anywhere in the stack, counts the requests and replies passing through and the attributes they contain. This data is stored in on-disk tdbs in the private/debug directory. The module is not loaded by default. To load it you need to patch the source4/dsdb/samdb/ldb_modules/samba_dsdb.c and put "count_attrs" somewhere in the module lists in the samba_dsdb_init() function. For example, to examine the traffic between repl_meta_data and group_audit_log, you would do something like this around line 316: "subtree_delete", "repl_meta_data", + "count_attrs", "group_audit_log", "encrypted_secrets", and recompile. Samba will then write to a number of tdb files in the debug directory as requests and replies pass through. A simple script is included to read these files. Doing this: ./script/attr_count_read st/ad_dc/private/debug/debug/attr_counts_not_found.tdb will print a table showing how often various attritbutes were requested but not found (from the point of view of the module). A more sophisticated version of the script is coming in the next commit, but this one is included first because in its simplicity it documents the storage format reasonably well. The tdb keys are attribute names, and the values are uint32_t in machine native order. When the module is included in the stack there will be a very small decrease in performance. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>