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

several changes to emphasize setup and use of auto-archiving rather than real-time processing #16603

Merged
merged 18 commits into from Nov 4, 2020

Conversation

diosmosis
Copy link
Member

@diosmosis diosmosis commented Oct 23, 2020

Fixes #6210

Changes:

  • Add blurb to installation finished twig about cron setup.
  • Make cron setup an actual diagnostic instead of an informational result.
  • Emphasize system check widget in settings home so items are more likely to be noticed and taken care of.
    • Also make tooltip use first diagnostic result's comment if there is no long message and use jquery tooltip to make them more noticeable.
  • Allow view access users to create auto archive segments.
  • Show count of pre-processed vs real-time segments in system summary.

TODO:

  • automated tests for segment creation change (allowing view access) once the PR is reviewed

Screenshots:

System Check Dash

image

Installation

image

System Summary

image

@diosmosis diosmosis added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Oct 23, 2020
@diosmosis diosmosis added this to the 4.0.0-RC milestone Oct 23, 2020
@@ -27,6 +27,10 @@
</p>
{% endif %}

<h3>Performance Settings</h3>
<p>{{ 'Installation_PerformanceSettingsDesc1'|translate('<a href="https://matomo.org/docs/setup-auto-archiving/" rel="noreferrer noopener">', '</a>')|raw }}</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add a target _blank here for both links @diosmosis ? That be great as when I clicked on it I left the installer

plugins/SegmentEditor/SegmentEditor.php Outdated Show resolved Hide resolved
// we require view access only when only pre processed can be created
Piwik::checkUserHasViewAccess($idSite);
}
Piwik::checkUserHasViewAccess($idSite);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be possible to set autoArchive=1 only when browser archiving is disabled? Otherwise the segment would be never archived?

We'll also need to adjust the config text in enable_create_realtime_segments as it no longer restricts which kinds of users can create segments to be archived on-demand. Could later if needed add a new setting like require_admin_access_for_preprocessed_segments=0 but not needed for now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be possible to set autoArchive=1 only when browser archiving is disabled?

I think you mean when cron archiving isn't set up, but I don't think there's a good way to check for that? If browser archiving is enabled and cli archiving is enabled, then it should be possible to use auto archive.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should see having both browser archiving and cli archiving enabled as a use case? Of course few users might do it (eg because they forget to disable browser archiving) but it should be rather edge cause and most of the times there wouldn't be much of a benefit of having both running AFAIK. Unless there would be some?

@@ -131,7 +131,7 @@
"SystemCheckWriteDirs": "Directories with write access",
"SystemCheckWriteDirsHelp": "To fix this error on your GNU\/Linux system, try typing in the following command(s)",
"SystemCheckZlibHelp": "You need to configure and rebuild PHP with \"zlib\" support enabled, --with-zlib.",
"SystemCheckCronArchiveProcess": "Archive Cron",
"SystemCheckCronArchiveProcess": "Setup Cron",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still finding it useful if it could be a bit more clear what the outcome/result is of fixing this warning so users will pay more attention to it as "Setup cron" you would likely simply ignore. Like "Setup Cron (faster report loading)" or something. Not too important but I think it will get the attention of users a lot more

@@ -82,7 +82,7 @@
"PivotBySubtable": "This report is not pivoted %1$s Pivot by %2$s",
"SystemSummaryWidget": "System Summary",
"SystemSummaryNWebsites": "%d websites",
"SystemSummaryNSegments": "%d segments",
"SystemSummaryNSegments": "%1$d segments (%2$s pre-processed, %3$s processed in real-time)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

54 segments (7 pre-processed, 47 processed in real-time)

could we maybe rename %2$s pre-processed to something like %2$s processed in background or so? Although I reckon that doesn't make it much more clear what it means either.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about processed periodically? Or reports generated periodically vs reports generated in real-time?

Copy link
Member

@tsteur tsteur Oct 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reckon we can actually just leave it as it is. I don't think any other wording makes it more clear. Same for processed via cron etc.

Copy link
Member

@tsteur tsteur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diosmosis I reckon the only remaining change needed is to set in segment editor "pre-processed" as default when browser archiving is disabled. For me so far it still always shows real time as default
image

I also created a follow up issue #16646 to eventually improve segment editor as the option is barely visible depending on the resolution and people currently wouldn't know what to select when.
image

// we require view access only when only pre processed can be created
Piwik::checkUserHasViewAccess($idSite);
if (Rules::isBrowserTriggerEnabled()) {
throw new Exception("Pre-processed segments can only be created if browser triggered archiving is disabled.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a link to https://matomo.org/docs/setup-auto-archiving/ if it's a super user? Like To disable browser archiving follow the instructions in https://matomo.org/docs/setup-auto-archiving/ . Just to give them an idea of what to do next.

@diosmosis
Copy link
Member Author

@tsteur applied some changes

@@ -56,10 +56,10 @@
</strong></div>
{{ 'General_And'|translate }} <div class="auto_archive"><strong>
<select class="auto_archive_select">
{% if createRealTimeSegmentsIsEnabled %}
{% if createRealTimeSegmentsIsEnabled or isBrowserArchivingEnabled %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diosmosis not sure this change is actually needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tsteur you said:

I reckon the only remaining change needed is to set in segment editor "pre-processed" as default when browser archiving is disabled.

<option selected="1" value="0">{{ 'SegmentEditor_AutoArchiveRealTime'|translate }} {{ 'General_DefaultAppended'|translate }}</option>
{% endif %}
<option {% if not createRealTimeSegmentsIsEnabled %}selected="1"{% endif %} value="1">{{ 'SegmentEditor_AutoArchivePreProcessed'|translate }} </option>
<option {% if not createRealTimeSegmentsIsEnabled and not isBrowserArchivingEnabled %}selected="1"{% endif %} value="1">{{ 'SegmentEditor_AutoArchivePreProcessed'|translate }} </option>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw probably not an issue but do we maybe need to remove selected="1" from the previous option when selecting this one by default? I suppose the browser in this case automatically selects the later one?

I'm thinking maybe it needs to use an or and not an and? Like we want to preselect this one either when browser archiving is disabled or when real time segment is not allowed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should be mutually exclusive conditions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diosmosis I just disabled browser archiving but real time was still the default. It could alternatively be simplified to if not isBrowserArchivingEnabled.

Otherwise it would be only the default if someone was to disable real time segments but only few people would do this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tsteur that may be because browser archiving of segments is still enabled. Can you check that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's possible. I think we'd want to still enable it though by default in that case see #6210 (comment)
image

and then in #6210 (comment)
image

It wasn't really meant in relation to the segment specific archive setting but just the general browser archiving setting.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will ignore segment specific archiving.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tsteur changed.

@@ -56,10 +56,10 @@
</strong></div>
{{ 'General_And'|translate }} <div class="auto_archive"><strong>
<select class="auto_archive_select">
{% if createRealTimeSegmentsIsEnabled %}
{% if isBrowserArchivingEnabled %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would need to be reverted to the original if createRealTimeSegmentsIsEnabled ? If browser archiving is disabled, then you might still want to create a segment for "real time" if you use the segment for example only for the "visits log" or if you view it very rarely. It should just not be selected by default.

Copy link
Member

@tsteur tsteur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one more comment @diosmosis and then feel free to merge once the tests pass.

@diosmosis
Copy link
Member Author

@tsteur updated again, will merge if tests pass and no further comments

@tsteur
Copy link
Member

tsteur commented Nov 3, 2020

Great. Thanks @diosmosis

@diosmosis diosmosis merged commit 375dd9f into 4.x-dev Nov 4, 2020
@diosmosis diosmosis deleted the 6210-cli-archiving-related-tweaks branch November 4, 2020 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Detect when stats load slowly and explain to user to disable Browser trigger archiving in Admin
2 participants