Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spin out Statistics dashboard view into its own project? #212

Open
emyoulation opened this issue Sep 15, 2022 · 16 comments
Open

Spin out Statistics dashboard view into its own project? #212

emyoulation opened this issue Sep 15, 2022 · 16 comments

Comments

@emyoulation
Copy link

I've had to remove the CardView add-on.

Performance of Gramps cratered in all views as I added People, Events & Families. Even when the Dashboard was not the active category, the command line log was showing constant update every time an object was added to the tree.

I tried to remove JUST the Statistics CardView view with the Plugin Manager. But that removed ALL CardViews.

Could the Statistics add-on be segmented out so that it can be installed & removed independently?

@emyoulation
Copy link
Author

emyoulation commented Sep 19, 2022

I tried turning off all the panels in the Statistics Dashboard CardView configuration. Then switched to the People view and added a person. The command window still reported the render_page activity in a non-active view Category and view mode:

render_page: dashboard 0.06200146675109863
stats collected: 3.99782395362854
render_page: statistics 0.3580019474029541
render_page: statistics 0.19899988174438477
render_page: dashboard 0.24299407005310059
render_page: statistics 0.09700202941894531

I also tried duplicating the card_view_statistics.py and stripping out everything but the commented header.
(In this case, the Configuration was left default)

But the command console still reporting time spent gathering statistics.

How can I turn off the statistics and its runtime impact of gathering stats?

@cdhorn
Copy link
Owner

cdhorn commented Oct 5, 2022

I did setup so changes should incrementally update the last changed list without fully recalculating the statistics and trigger a refresh for the last changed view. But agree if view not visible a redraw should defer.

There is a huge chunk of shared code between everything so splitting out into a fully separate project doesn't make sense.

You can of course edit the .gpr to comment out any of the views.

@emyoulation
Copy link
Author

You can of course edit the .gpr to comment out any of the views.

thanks. I had not thought of that!

@emyoulation
Copy link
Author

emyoulation commented Oct 18, 2022

Could you add the a configuration option to COMPLETELY bypass the Statistics view mode burden from the CardView?

Maybe have a conditional that just turns the View Mode into a placeholder? So it paints a big "Statistics view mode \n Disabled via Configure" across the main Window area (so nothing breaks that calls specific View Modes) and skips ALL the rest of the main view program... including the stats gathering in the card_view.py (lines 72 & 129)

Gramps has become very sluggish with the CardView active. Even after I commented out the Statistics .gpr.py registration for the view mode.

@cdhorn
Copy link
Owner

cdhorn commented Oct 23, 2022

Could you add the a configuration option to COMPLETELY bypass the Statistics view mode

I will try to add an option to do so. The config option will need to be in the gramps.ini as it needs to be accessible before the view initializes, and after changing will need a full restart.

@cdhorn
Copy link
Owner

cdhorn commented Oct 23, 2022

FYI, the last changed dashboard concept is being retired. I have refactored the previous Gramplet, renaming it LastModified in the process, and it is in a separate repo for the moment. If anyone is able to test it would be appreciated. If no problems I'll submit to the addons repository.

Note this refactor does NOT support BSDDB databases as it queries the database to extract the lists which is significantly faster. It will notify the user of that if it detects the database does not support the dbapi.

@cdhorn
Copy link
Owner

cdhorn commented Oct 24, 2022

Commit c5f04b0 removes the last changed dashboard, per my comments above. It also adds a toggle that can be used to disable the statistics dashboard if desired. This is only accessible in one place for now, the configuration context menu (middle mouse click when on a card view) at the bottom and requires a restart.

@emyoulation
Copy link
Author

Very nice! I wasn't expecting the CardView Dashboard to be disabled by default. But that makes sense.

I was able to Enable & Disable the view in Windoze. Thank you.

For some reason, the Relationship cardview was initially stuck on the Home Person. It wouldn't change when clicking on a sibling. Went to another view, change people and then back and it was 'unstuck'

@cdhorn
Copy link
Owner

cdhorn commented Oct 25, 2022

Hmm interesting. I hope I didn't introduce a regression somewhere.

Let me know how the new Last Modified Gramplet works for you. It should be much more performant.

I also just threw Type Export and Type Import Gramplets out there only cause I saw the discussion on Discourse a short while ago.

@emyoulation
Copy link
Author

Sounds very interesting. But it's going to have wait until tomorrow. My computer was unplugged due to severe thunderstorms & some tornados tonight.

@emyoulation
Copy link
Author

Are the Type Export and Type Import Gramplets in response to Tinkerbelle's posting: Role in event entry where you posted:

I suppose we should either update the xml export/import to account for the lists in 5.2 or, if there is some reason they were deliberately left out, throw together a tool that could be used to export/import them separately.

@emyoulation
Copy link
Author

First load of Last Modified in People CardView sidebar in Example.gramps tree:

render_page: I0000044 6.4814841747283936
2022-10-25 08:30:14.228: WARNING: _gramplet.py: line 342: Gramplet gave an error: Last Modified
Traceback (most recent call last):
  File "C:\Program Files\GrampsAIO64-5.1.5\gramps\gen\plug\_gramplet.py", line 326, in _updater
    retval = next(self._generator)
  File "C:\Users\DistrictSupport\AppData\Roaming\gramps\gramps51\plugins\LastModified-main\last_modified.py", line 195, in main
    self.change_history = self.change_service.get_change_history()
  File "C:\Users\DistrictSupport\AppData\Roaming\gramps\gramps51\plugins\LastModified-main\last_modified.py", line 458, in get_change_history
    self.__build_history()
  File "C:\Users\DistrictSupport\AppData\Roaming\gramps\gramps51\plugins\LastModified-main\last_modified.py", line 425, in __build_history
    self.dbstate.db, handle_list
  File "C:\Users\DistrictSupport\AppData\Roaming\gramps\gramps51\plugins\LastModified-main\last_modified.py", line 895, in get_formatted_handle_list
    label, dummy_obj = get_object_label(db, object_type, object_handle)
  File "C:\Users\DistrictSupport\AppData\Roaming\gramps\gramps51\plugins\LastModified-main\last_modified.py", line 881, in get_object_label
    name, obj = navigation_label(db, object_type, object_handle)
  File "C:\Program Files\GrampsAIO64-5.1.5\gramps\gen\utils\db.py", line 357, in navigation_label
    src = db.get_source_from_handle(obj.get_reference_handle())
  File "C:\Program Files\GrampsAIO64-5.1.5\gramps\gen\db\generic.py", line 1291, in get_source_from_handle
    return self._get_from_handle(SOURCE_KEY, Source, handle)
  File "C:\Program Files\GrampsAIO64-5.1.5\gramps\gen\db\generic.py", line 1270, in _get_from_handle
    raise HandleError('Handle %s not found' % handle)
gramps.gen.errors.HandleError: Handle f2742c9806f67a117194e09bc41 not found
Continuing after gramplet error...

@cdhorn
Copy link
Owner

cdhorn commented Oct 26, 2022

| Are the Type Export and Type Import Gramplets in response to Tinkerbelle's posting: Role in event entry

Yes, it is pretty trivial to do. Most users likely won't have a use for it but some might.

@cdhorn
Copy link
Owner

cdhorn commented Oct 26, 2022

| First load of Last Modified in People CardView sidebar in Example.gramps tree:

Interesting. I will add something to catch that when I have a chance.

@emyoulation
Copy link
Author

I like it. Users can share their collections of custom types much more easily now.

@emyoulation
Copy link
Author

Re-enabled the CardViews and Dashboard Statistics card view. I'll watch for performance hits.

In the discussion about the Age Stats gramplet, Nick proposed an option to apply filtering to dashboard gramplets. Perhaps you might want to touch base with him to determine if such a change would impact your view mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants