GNOME Bugzilla – Bug 735167
Display statistics and match rules from the new Stats interface
Last modified: 2018-01-24 12:00:37 UTC
D-Bus has a Stats interface with useful information that are not displayed in d-feet. At the moment, dbus needs to be recompiled with --enable-stats, but I am hoping to improve the situation: https://bugs.freedesktop.org/show_bug.cgi?id=80759 And D-Bus match rules should be added soon too: https://bugs.freedesktop.org/show_bug.cgi?id=24307 The attached patch on d-feet displays the stats and the match rules to the user.
Created attachment 284093 [details] [review] [PATCH] display statistics and match rules from the D-Bus Stats interface
Created attachment 287583 [details] [review] [PATCH] display statistics and match rules from the D-Bus Stats interface All the needed changes are released in dbus 1.9.0.
Hi Alban, thanks for the patch. I'm currently busy and don't have dbus >= 1.9.0 but I'll test it in the next weeks. Hope that's fine.
Created attachment 364700 [details] [review] display statistics and match rules from the D-Bus Stats interface This requires dbus 1.9.0 for the new GetAllMatchRules call on the Stats interface and for compiling the Stats interface by default. The Stats interface is enabled by default on the session bus. On the system bus, it is not enabled for non-root users by default but it can be enabled as shown in /usr/share/doc/dbus/examples/example-system-enable-stats.conf If the feature is not available in D-Bus, D-Feet ignores the error and continues as before.
I rebased Alban's patch, fixing one merge conflict. I modified the workaround for https://bugzilla.gnome.org/show_bug.cgi?id=735166 – according to that bug, GLib.Variant('(s)', (foo,)) was never affected by the bug in question, and I think it's more legible anyway. I also added a 'self.name is not None' check, without which the test case fails. (For some reason it constructs the object with name=None and unique_name='org.freedesktop.DBus', even though in the real application both names are (correctly) 'org.freedesktop.DBus' for the bus itself. There's an argument that this stats code should use self.unique_name (if it's available), I suppose. It's a bit sad that GetAllMatchRules() fetches all rules, every time you select a bus name, then throws all bar one key away. It would be nicer if the bus provided GetConnectionMatchRules but I'm sure there's a reason it doesn't. It's also a little weird that this adds “Match rules” and “Statistics” rows right under the title “Object path” for the treeview. Might it be better to have a button in the Address/Name/Unique name section above the treeview to show statistics in a dialog? (Better to have this available than not, of course!)
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/d-feet/issues/6.