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

Event monitor: Implement cron task to clean events table

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Fixed
    • Minor
    • 2.8
    • 2.7
    • Reports
    • MOODLE_27_STABLE
    • MOODLE_28_STABLE
    • MDL-46133_master
    • Hide
      Test 1
      1. Run all the tests in admin/tool/monitor/tests/task_clean_events_test.php.
      Test 2
      1. Visit a course.
      2. Visit 'Course administration' -> 'Reports' -> 'Event monitor' -> 'Manage rules'.
      3. Add a few rules (remember the events you chose) and set the field 'in minutes' to 10.
      4. Go to the course and perform numerous actions, including those required to trigger the events you select earlier (add a bunch of different activities, view them, perform actions - we basically want to trigger a lot of events).
      5. View the content of the table 'tool_monitor_events' and ensure there are a bunch of events that you created.
      6. Run the cron.
      7. View the table again and check that all the events not associated with the ones you chose on the management rule page are gone.
      8. Wait over 10 minutes and run the cron again.
      9. Check that the table is empty.
      Show
      Test 1 Run all the tests in admin/tool/monitor/tests/task_clean_events_test.php. Test 2 Visit a course. Visit 'Course administration' -> 'Reports' -> 'Event monitor' -> 'Manage rules'. Add a few rules (remember the events you chose) and set the field 'in minutes' to 10. Go to the course and perform numerous actions, including those required to trigger the events you select earlier (add a bunch of different activities, view them, perform actions - we basically want to trigger a lot of events). View the content of the table 'tool_monitor_events' and ensure there are a bunch of events that you created. Run the cron. View the table again and check that all the events not associated with the ones you chose on the management rule page are gone. Wait over 10 minutes and run the cron again. Check that the table is empty.
    • 20
    • BACKEND Sprint 17

    Description

      Implement a cron task to clean tool_monitor_events periodically.

      There are three ways do this:-

      1. Truncate the table unconditionally every x hours
      2. Implement a smart logic that reads various rules and finds which event entries are not useful any more and dumps them only.
      3. Implement a semi -smart logic which finds out the maximum "timewindow" used in rules and dumps every thing beyond that.

      Imho, 1 is not acceptable, 2 seems ideal, 3 is easiest to implement and more performance friendly than 2.

      Attachments

        Issue Links

          Activity

            People

              markn Mark Nelson
              ankit_frenz Ankit Agarwal
              Ankit Agarwal Ankit Agarwal
              Sam Hemelryk Sam Hemelryk
              Frédéric Massart Frédéric Massart
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.