backdrop-contrib / project

Projects associate a code-based project with releases and power the update server of BackdropCMS.org
2 stars 10 forks source link

Fix default stale_age for telemetry data. #59

Closed yorkshire-pudding closed 1 week ago

yorkshire-pudding commented 1 month ago

The original intention was for the default time by which data would be considered stale was 2 weeks but the actual default has been set as 1 hour; project_telemetry_cron() runs every six hours so currently every 6 hours any data older than 1 hour is deleted. As sites only report once a day (telemetry_cron()), this means the data is never representative of the full population of Backdrop sites reporting telemetry.

/**
 * Delete stale data past a certain age.
 *
 * @param int $stale_age
 *   The number of seconds by which data will be considered stale. Defaults
 *   to 604800 seconds (2 weeks).
 */
function project_telemetry_delete_stale_data($stale_age = 3600) {
  db_delete('project_telemetry_raw')
    ->condition('timestamp', REQUEST_TIME - $stale_age, '<')
    ->execute();
}

Note: 604,800 seconds = 1 week; 1,209,600 seconds = 2 weeks

quicksketch commented 1 month ago

Hah, wow all over the place there! This must have been reduced while we were testing Telemetry. I bet our numbers for core will go up quite a bit after this change.

yorkshire-pudding commented 1 month ago

@quicksketch - do you know when you'll be able to review this? I think b.org is likely to need an update soon for the Social Fields issue so it would be great if we could get this fix in also. Thanks

yorkshire-pudding commented 2 weeks ago

@quicksketch - just a reminder that this is still waiting. Thanks.

quicksketch commented 1 week ago

Thanks for the reminder @yorkshire-pudding. I merged it and tagged a new release.