#49595 Issue 49593 - NDN cache stats should be under the global stats
Closed by spichugi. Opened by spichugi.
spichugi/389-ds-base ndn_cache_move  into  master

Download 49595.patch

Bug description: The Normalized DN cache stats are listed under
backend stats, but the cache is global across all backends so
they should just be listed under the global ldbm monitor.

Fix description: Move NDN stats to global ldbm monitor.
Change lib389 MonitorLDBM and MonitorBackend objects accordingly.
Fix dbmon.sh tool so it shows the stats like this:
Wed Mar 7 12:50:14 EST 2018
dbcachefree 52150272 free% 99.812 roevicts 0 hit% 100 pagein 0 pageout 0
dbname count free free% size hit_ratio
global:ndn 69 20960096 99.946 165.565 73
userroot:ent 2 201318969 100.0 3811.5 62.0
userroot:dn 2 67108738 100.0 63.0 0.0

https://pagure.io/389-ds-base/issue/49593

Reviewed by: ?

/rebuild

rebased onto e98f6ccc26207840a87dd58b59fca73ad492c3f2

Whoops, got some compiler warnings:

../389-ds-base/ldap/servers/slapd/back-ldbm/monitor.c: In function ‘ldbm_back_monitor_instance_search’:
../389-ds-base/ldap/servers/slapd/back-ldbm/monitor.c:55:12: warning: unused variable ‘slots’ [-Wunused-variable]
     size_t slots;
            ^~~~~
../389-ds-base/ldap/servers/slapd/back-ldbm/monitor.c:54:12: warning: unused variable ‘evicts’ [-Wunused-variable]
     size_t evicts;
            ^~~~~~
../389-ds-base/ldap/servers/slapd/back-ldbm/monitor.c:53:12: warning: unused variable ‘thread_size’ [-Wunused-variable]
     size_t thread_size;
            ^~~~~~~~~~~
../389-ds-base/ldap/servers/slapd/back-ldbm/monitor.c:51:32: warning: unused variable ‘count’ [-Wunused-variable]
     long nentries, maxentries, count;

Otherwise it looks good and works for me

rebased onto 5e4866978921d42ba6db4662186496becb0d040c

Fixed. Thank you!

/rebuild

Sorry this is really minor, and I missed it earlier, but please don't use tabs (just 4 spaces)

rebased onto ac34506de06ab187838a01a48b996d715ddfa2ab

/rebuild

Ok, I've used a wrong editor which wasn't properly set up. Sorry. Fixed :)

Don't use long, it's an undefined size. If we are touching this, we should change it to int64_t or int32_t.

Use uint64_t not PRUint64.

Again, don't use long :)

change %lu to PRIu64/32 as needed.

As above,

I wonder if ndn_cache_started is actually thread safe, we have a few functions like this which aren't correct, but that's probably another ticket ...

rebased onto 781151c85152ccda697c7a135432b9b902acd25f

Ahhh I see the issue here. You have maxsize as size_t, but you have PRIu64. Size_t is platform specific width, so you could change maxsize to be a uint64_t instead to avoid this.

rebased onto 283f933e69c06d9bcf81cd7e103888132e363207

Great! Ack from me. Awesome to see you contributing to the server now :)

rebased onto 0f0725c9296228b8d3a6729572ab60c4b1721791

Pull-Request has been merged by spichugi

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

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

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

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

Metadata