Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable time_spent logging in the user_levels table #36496

Merged
merged 2 commits into from
Aug 28, 2020

Conversation

jmkulwik
Copy link
Contributor

time_spent logging was disabled by this PR (#36380) so we could convert milliseconds to seconds for existing time_spent records. Now that is finished, and time_spent logging can be re-enabled.

Background

Given that the mysql limit for an integer is 2,147,483,648 (roughly 25 days when measured in milliseconds), we realized we needed capacity for longer periods of time to be recorded in the time_spent field. It is reasonable to expect a student may spent more than 25 days of total time on a long-term project. Additionally, we continue recording time_spent if the student leaves their browser window open but is not actively working on their computer, which could also increase the time a student spends on their project.

time_spent is currently recording milliseconds. Intervals of time less than one second are not useful for these purposes. Instead, we will record seconds. This will give us capacity to record over 68 years of time_spent on a user_level.

To migrate to recording seconds, we need to take two actions.

  1. Divide the time sent from the client by 1000
  2. Migrate all existing records to seconds
    a. Stop recording time_spent
    b. Migrate all existing records from milliseconds to seconds
    c. Re-enable recording time_spent

This PR achieves step 2c

1 and 2a were achieved by this pr: #36380
2b was achieved by this pr: #36398

Links

Testing story

Reviewer Checklist:

  • Tests provide adequate coverage
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@jmkulwik jmkulwik requested review from a team, clareconstantine, mvkski and cforkish and removed request for a team August 28, 2020 17:37
@jmkulwik jmkulwik merged commit 39d6bb7 into staging Aug 28, 2020
@jmkulwik jmkulwik deleted the re-enable-time-spent-logging branch August 28, 2020 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants