Milimetric has submitted this change and it was merged.
Change subject: Stop extraneous report runs for parent of recurrent reports
......................................................................
Stop extraneous report runs for parent of recurrent reports
When creating a recurrent report, the parent run itself first
computed a report with data from today 00:00 until now. This report
got stored with the current date as filename. Afterwards the parent
run scheduled a first recurrent report run for data from yesterday
00:00 until today 00:00. This second run also got stored with the same
current date as filename.
By both reports using the same filename, the parent run's data
immediately got overwritten by the first child's run. This takes place
before the first coalesced report get generated. Hence, the data
computation for the parent run is unnecessary, and only wastes
resources. So we drop the data computation step from the parent run,
as it would also get in the way when we implement replication lag
dependent recurrent report runs in follow-up commits.
Change-Id: Ib4a000288de506a32b2cf4c16e72d7dc35af572a
---
M wikimetrics/models/report_nodes/run_report.py
1 file changed, 16 insertions(+), 4 deletions(-)
Approvals:
Milimetric: Looks good to me, approved
diff --git a/wikimetrics/models/report_nodes/run_report.py
b/wikimetrics/models/report_nodes/run_report.py
index 07a3820..8d07660 100644
--- a/wikimetrics/models/report_nodes/run_report.py
+++ b/wikimetrics/models/report_nodes/run_report.py
@@ -82,13 +82,14 @@
self.show_in_ui = False
public = parameters.get('public', False)
+ recurrent = parameters.get('recurrent', False)
super(RunReport, self).__init__(
name=parameters['name'],
user_id=user_id,
parameters=parameters,
public=public,
- recurrent=parameters.get('recurrent', False),
+ recurrent=recurrent,
recurrent_parent_id=recurrent_parent_id,
created=created,
)
@@ -100,9 +101,20 @@
metric, cohort, recurrent_parent_id is None, user_id=user_id
)
if validate_report.valid():
- self.children = [AggregateReport(
- metric, cohort, metric_dict, parameters=parameters,
user_id=user_id
- )]
+ if recurrent and recurrent_parent_id is None:
+ # Valid parent recurrent report
+ # We do not add children that compute data as parent recurrent
+ # reports just help the scheduler orchestrate child runs. The
+ # initial run for this report will be kicked off in
+ # post_process.
+ self.children = []
+ else:
+ # Valid, but not a parent recurring report, so we add the child
+ # node that does the real computation
+ self.children = [AggregateReport(
+ metric, cohort, metric_dict, parameters=parameters,
+ user_id=user_id
+ )]
else:
self.children = [validate_report]
--
To view, visit https://gerrit.wikimedia.org/r/154799
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib4a000288de506a32b2cf4c16e72d7dc35af572a
Gerrit-PatchSet: 3
Gerrit-Project: analytics/wikimetrics
Gerrit-Branch: master
Gerrit-Owner: QChris <[email protected]>
Gerrit-Reviewer: Milimetric <[email protected]>
Gerrit-Reviewer: Nuria <[email protected]>
Gerrit-Reviewer: QChris <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits