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

Allow different reports pre-archiving frequency for each period #11979

Merged
merged 8 commits into from Sep 4, 2017

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Aug 28, 2017

refs #11965

Added new config setting time_before_$period_archive_considered_outdated = -1 to allow configuration of archive frequency per period. By default, nothing changes and it falls back to regular UI setting (or config setting for today).

If value is configured and set to > 0, the value for that period will be applied.

We could be smart and eg if today is set to 600, but weekly is set to 300, then we would still use 600 as there "shouldn't" be any updated version but it would be tricky to hard code this in there. Also the config name is generated generic based on "periodLabel" as several people are adding new features to allow new periods.

When using cron archive, it may still send an archive request for a period but it shouldn't actually archive it. A simple test would be to do a full archive. Then set the setting for week period eg to 6000 and you will notice the weekly archive will be finished in a second. Then change setting back to "1" and you will notice it will re-archive the weekly archive.

If setting name and behaviour is fine, we will need to add it to developer changelog and maybe also consider another PR on top of this and #11972 (once #11972 is merged) to possibly allow archives that are even older than 12 hours if the period archives are supposed to be only archived eg every 24 hours.

There are no tests right now as there are no tests in general for the Rules class. Can add one though.

@mattab any thoughts? Be nice to have this in 3.1.0 already.

@tsteur tsteur added 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. labels Aug 28, 2017
@tsteur tsteur added this to the 3.2.0 milestone Aug 28, 2017
Copy link
Member

@mattab mattab left a comment

Choose a reason for hiding this comment

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

  • We display in the core:archive output the settings values, could we also display the period values when they have been overwritten? (see $this->logger->info("- Reports for today will be processed at most every " . $this->todayArchiveTimeToLive)

Nice change!

time_before_month_archive_considered_outdated = -1

; Same as config setting "time_before_week_archive_considered_outdated" but it is only applied to yearly archives
time_before_year_archive_considered_outdated = -1
Copy link
Member

Choose a reason for hiding this comment

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

also should work to range so let's add it maybe?

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
Copy link
Member Author

tsteur commented Aug 28, 2017

Printing the values now if they are customized. It still shows below always

"Reports for the current week/month/year will be refreshed at most every 3600 seconds." since the min archive time check is done when trying to archive and not in CronArchive itself.

@mattab
Copy link
Member

mattab commented Sep 1, 2017

Would merge once tests are green

@mattab mattab modified the milestones: 3.1.0, 3.2.0 Sep 1, 2017
@mattab mattab merged commit 8a23b7e into 3.x-dev Sep 4, 2017
@mattab mattab deleted the archive_frequency_period branch September 18, 2017 03:08
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.

None yet

2 participants