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

Disable recording of time_spent while we convert current records from milliseconds to seconds #36380

Merged
merged 1 commit into from
Aug 20, 2020

Conversation

jmkulwik
Copy link
Contributor

@jmkulwik jmkulwik commented Aug 20, 2020

This PR temporarily disables recording of time_spent to the user_levels table. (PR That implemented: #36121)

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 steps 1 and 2a

Internal folks can read more details in this slack thread.

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 20, 2020 22:40
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