Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-68052

Implement cleanup of analytics_indicator_calc stores table

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.8.1
    • Fix Version/s: 3.11
    • Component/s: Analytics
    • Labels:
    • Testing Instructions:
      Hide
      1. Set the new "analytics/calclifetime" admin setting (Analytics > Analytics settings) to 35 days (default).
      2. Check the number of records in your analytics_indicator_calc table and make sure there are some that have a timecreated older than 35 days.
        • If you don't have records that are older than 35 days then update some of the records so that they are.
      3. Run the cleanup task.

        php admin/cli/scheduled_task.php --execute='\core\task\analytics_cleanup_task'
        

      4. Verify it ends without error.
      5. Check the analytics_indicator_calc table and make sure records older than 35 days have been removed.
      Show
      Set the new "analytics/calclifetime" admin setting (Analytics > Analytics settings) to 35 days (default). Check the number of records in your analytics_indicator_calc table and make sure there are some that have a timecreated older than 35 days. If you don't have records that are older than 35 days then update some of the records so that they are. Run the cleanup task. php admin/cli/scheduled_task.php --execute='\core\task\analytics_cleanup_task' Verify it ends without error. Check the analytics_indicator_calc table and make sure records older than 35 days have been removed.
    • Affected Branches:
      MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_311_STABLE
    • Pull Master Branch:

      Description

      Would it be possible to implement automated cleanup of the mdl_analytics_indicator_calc table?  This would be useful prevent table from becoming too large.  For example, in one Moodle site with a 65 GB database, the table is currently 25 GB in size.

        Attachments

          Activity

            People

            Assignee:
            danmarsden Dan Marsden
            Reporter:
            thomas-its Thomas College ITS
            Peer reviewer:
            Paul Holden
            Integrator:
            Adrian Greeve
            Tester:
            Mathew May
            Participants:
            Component watchers:
            Elizabeth Dalton, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              10/May/21

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 30 minutes
                2h 30m