-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
introduce RecordBuilder concept to split up Archiver code and use in …
…Goals (#20394) * introduce RecordBuilder concept and re-organize Goals archiving code via RecordBuilders * fix loop iteration bug * split ecommerce records recordbuilder into 3 separate records * make sure Goals::getRecordMetadata() behaves like old archiver code * make sure recordbuilder archive processor is restored after being used since archiving is a recursive process * just make ArchiveProcessor a parameter * check for plugin before calling buildMultiplePeriod() * do not invoke record builders if archiver has no plugin (happens during tests) * insert empty DataTables (as this appears to be the existing behavior before this change) * add RecordBuilder class name to aggregation query hint * clear up in-source todo * attempt only archiving requested report if range archive and the record needed is created by a RecordBuilder * refactor ArchiveSelector::getArchiveIds() to provide result with string keys * when all found archives are partial archives, check that requested data is present within them. if some are not present, only archive those in a new partial archive. * return correct value in Model::getRecordsContainedInArchives() * fix if formatting * existingArchives can be falsy * existing archives can be null if the check is not relevant to the current archive request * do not archive dependent segments if only processing the specific requested report * fix more tests * fix LoaderTest * make sure if archiving specific reports for a single plugin that archiver class instances will not be created * add filterRecordBuilders event * if it looks like the requested records are numeric, prioritize the numeric archive table, otherwise blob archive table * fix copy-paste error * add dummy test for numeric values * add test for partial archiving of numeric records for ranges and fix typo causing this to fail * lessen code redundancy in Archive.php, use Piwik\\Request and do not yet mark RecordBuilder as api * fix type hint * fix php-cs errors * fix failing tests * fix failing tests (really) * fix isEnabled calls * only add idarchive to Archive.php idarchive cache if it is not already there (makes debugging a little less confusing) * remove unneeded TODO * when forcing new archive because timestamp is too old, do not report any existing archives * report no existing archives if done flag is different + add tests * remove unneeded unset * fix phpcs * remove unneeded newline * use siteAware cache for RecordBuilder array * better typehints in RecordBuilder * ignore any records that are not declared in the record metadata (which can happen, for instance, when a goal has been deleted but is still referred to in log data) * apply review feedback * remove stray debugging change * Update variable name for consistency * Remove unnecessary array_filter since a valid class name never has an empty segment * Add TODOs * add comment on why we look for data within partial archives prior to reporting whether archives were found or not * typehint fixes + make insertBlobRecord (formerly insertRecord) protected for use in RecordBuilders that need to manually insert data * more typehints * in aggregateNumericMetrics() allow operationsToApply to be array mapping column name to op * optimization: when getting recordbuilders, only post Archiver.addRecordBuilders event for requested plugin since it is expected for those event handlers to perform queries * default to null if default column aggregation operation is not specified * add check for invalid record name to Record * allow dashes in record name since entity IDs can be used in them --------- Co-authored-by: Stefan Giehl <[email protected]> Co-authored-by: Michal Kleiner <[email protected]>
- Loading branch information
1 parent
a727364
commit adcae6d
Showing
26 changed files
with
1,986 additions
and
591 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.