This task is about creating three services in the GrowthExperiments extension.
Compute
The compute service, when given a user ID, should return an object containing:
- number of thanks received for the user ID
- Number of edits made by the user, split by namespace
- number of edits with "newcomer task" tag (suggested edits)
- date of last edit
- current edit streak and longest historical edit streak
- For each article that the user has edited:
- [optional] Number of page views for duration period
- [optional] data to populate sparkline showing the trends for page views for duration period
- [optional] Call-to-action links, depending on whether we determine that the user should be able to edit the article again or if other types of structured/unstructured edits are possible.
The items marked [optional] would require an additional flag to the service in order to fetch. The idea is that some of this data is cheap and fast to obtain by querying replica database tables (thanks, edit count, date of last edit) while other items are slower, and should not be done on page load. We would invoke the service on page load to export data to the front-end via mw.config using only the cheap/fast to load data points, and then the impact module could call the API on the client-side to get the longer-to-compute data points.
For each data point, we should store a timestamp associated with the computation of the data point.
Extensibility: The service should provide a hook to allow for other extensions to modify the computation of the data points.
Lookup
This service is used for fetching existing data for the user.
Extensibility: The service should provide a hook to allow other extensions to modify the data.
Storage
The storage service will use a MySQL table as the backend in the first iteration, in a future iteration, it may use the Data Gateway (T310253).
Extensibility: The service should provide a hook to allow other extensions to modify data before it is stored.