Commit Graph

48 Commits

Author SHA1 Message Date
Usama Sadiq
859df03049 refactor: ran pyupgrade on lms/djangoapps/courseware (#26737) 2021-03-12 12:15:58 +05:00
Jawayria
03e6a874d0 Applied pylint-amnesty to courseware 2021-02-03 21:56:24 +05:00
Tim McCormack
ea0c19066e Rename metric -> attribute in courseware New Relic code 2020-09-18 15:03:13 +00:00
SaadYousaf
db95b28b85 handle DeprecationWarning for usage_key.course_key for logs cleanup. 2020-04-15 15:16:58 +05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Ned Batchelder
efba6e45e8 Finally import courseware properly everywhere to get rid of a warning 2019-09-26 09:40:15 -04:00
aarif
64bd86c12c ran python-modernize and isort on files mentioned in INCR-435 2019-07-12 15:29:19 +05:00
Matthew Piatetsky
6e81c84d8b fix unicode strings in lms/ part 1 2019-02-05 15:15:02 -05:00
Diana Huang
6572d99e76 Remove all references to datadog from our code. 2019-01-08 15:41:24 -05:00
Robert Raposa
99c9eb7343 Migrate to edx-django-utils monitoring.
ARCH-220
2018-08-17 15:39:04 -04:00
Daniel Clemente Laboreo
6d3f8150db Implement generate_report_data for capa problems 2018-05-24 22:09:58 +03:00
Eric Fischer
e18448e27d Silence deprecation warnings
https://docs.djangoproject.com/en/1.11/releases/1.10/#using-user-is-authenticated-and-user-is-anonymous-as-methods
2018-05-02 10:03:50 -04:00
Daniel Clemente Laboreo
00c339d091 Implement iter_all_for_block and iter_all_for_course for DjangoUserStateClient 2018-04-20 11:26:16 +03:00
Joel Barciauskas
caf9901c1b [PLAT-1109] Suppress IntegrityErrors caused by race condition
Suppress IntegrityErrors that may be caused by a race condition
between processes resulting from a slow-loading page and a user refreshing the
page.
2018-04-11 13:47:11 +05:00
Andy Armstrong
79acb5c5be Reorder LMS imports using isort 2017-06-11 21:48:06 -04:00
Robert Raposa
77f111b2b1 Moves and rename common/djangoapps/newrelic_custom_metrics. 2017-03-31 15:19:53 -04:00
Troy Sankey
076c63bcf5 Instrument DjangoXBlockUserStateClient with New Relic
Report to New Relic certain per-request details about the
DjangoXBlockUserStateClient.  The following metrics are reported for the
get_many() call:

xb_user_state.get_many.calls
xb_user_state.get_many.duration
xb_user_state.get_many.blocks_requested
xb_user_state.get_many.blocks_out
xb_user_state.get_many.size
xb_user_state.get_many.<block_type>.blocks_requested
xb_user_state.get_many.<block_type>.blocks_out
xb_user_state.get_many.<block_type>.size

Similarly, for the set_many() call:

xb_user_state.set_many.calls
xb_user_state.set_many.duration
xb_user_state.set_many.blocks_created
xb_user_state.set_many.blocks_updated
xb_user_state.set_many.size
xb_user_state.set_many.<block_type>.blocks_created
xb_user_state.set_many.<block_type>.blocks_updated
xb_user_state.set_many.<block_type>.size

Where <block_type> is one of "chapter", "course", "problem", "video",
etc.

PERF-354
2016-11-03 10:30:38 -04:00
John Eskew
211cef0814 Ignore IntegrityErrors upon set_many update save(). 2016-08-24 13:48:42 -04:00
John Eskew
2252ce6abf Ignore IntegrityErrors upon set_many update save(). 2016-08-24 13:18:03 -04:00
J. Clifford Dyer
7b75d1d452 Add transformer that collects grading data.
TNL-4449
2016-05-26 16:15:34 -04:00
Ned Batchelder
2e1238b83e Remove unused imports 2016-04-08 11:23:05 -04:00
Kevin Falcone
6f9a3911e5 Implement a BaseStudentModuleHistory
This abstract class contains most of the fields (aside from the id and
foreign key to StudentModule that the subclasses need to manage).  It
also provides a get_history method that abstracts searching across
multiple backends.

Move router code to openedx/core
We need to use it from cms and lms.
Ensure aws_migrate can be used for migrating both the lms and cms.

Handle queries directed to student_module_history vs default and the
extra queries generated by Django 1.8 (SAVEPOINTS, etc).

Additionally, flag testing classes as multi_db so that Django will
flush the non-default database between unit tests.

Further decouple the foreignkey relation between csm and csmhe

When calling StudentModule().delete() Django will try to delete CSMHE
objects, but naively does so in the database, not by consulting the
database router.

Instead, we disable django cascading deletes and listen for post_delete
signals and clean up CSMHE by hand.

Add feature flags for CSMHE
One to turn it on/off so we can control the deploy.
The other will control whether or not we read from two database tables
or one when searching.

Update tests to explicitly use this get_history method rather than
looking directly into StudentModuleHistory or
StudentModuleHistoryExtended.

Inform lettuce to avoid the coursewarehistoryextended app

Otherwise it fails when it can't find features/ in that app.

Add Pg support, this is not tested automatically.
2016-02-29 13:59:27 -05:00
Sarina Canelake
8928e9ef19 Remove CallStackManager (PLAT-931) 2015-12-08 10:21:55 -05:00
John Eskew
ac05012d23 Add response times to get_many/set_many/delete_many. 2015-11-05 11:02:49 -05:00
Calen Pennington
ec49576eb4 Merge pull request #9387 from cpennington/csm-count-requested-blocks
Record the number of blocks requested in get_many
2015-09-03 13:37:30 -04:00
utkjad
387303d364 Injecting call stack manager in CSM/CSMH,introducting @trackit,@wrapt, and refining implementation[PLAT-758] 2015-08-26 22:29:43 +00:00
Calen Pennington
26f06d4a55 Record the number of blocks requested in get_many 2015-08-20 10:40:27 -04:00
Calen Pennington
3f9027d05e Log delete_many calls and metrics 2015-08-14 10:22:24 -04:00
Calen Pennington
448356ed3e Log the size of block state and the number of blocks missing state when retrieved with get_many 2015-08-13 16:32:05 -04:00
Calen Pennington
31f29763fd Increase sample rate when measuring DjangoXBlockUserStateClient metrics 2015-08-13 16:31:33 -04:00
Calen Pennington
93b1b69854 Don't violate the empty-dict vs None semantics of student_module during delete_many 2015-08-10 14:42:18 -04:00
John Eskew
f3e59acbf1 Add DataDog histogram events to DjangoXBlockUserStateClient class. 2015-08-04 17:14:05 -04:00
Calen Pennington
aa374ca12a Make DjangoXBlockUserStateClient pass semantic tests
This required the following changes to the DjangoXBlockUserStateClient
semantics:

1) Changes get/get_many to return XBlockUserState tuples, rather
than state dictionaries or (block_key, state) tuples.
2) Raises DoesNotExist if get_history is called on an XBlock that has
had no data saved to it.
3) Returns XBlockUserState tuples as the results of get_history.
2015-08-01 08:13:25 -04:00
Calen Pennington
53b37e7412 Remove extraneous documentation, contracts, and method definitions 2015-08-01 08:13:25 -04:00
utkjad
b85b50d11a Removing @contract 2015-07-31 17:44:16 +00:00
Sarina Canelake
b26f2af585 Revert "Adding entries of Call Stack Manager in StudentModule and StudentModuleHistory" 2015-07-07 05:45:23 -04:00
utkjad
10a3863832 Enable CallStackManager on StudentModule and StudentModuleHistory to capture any use outside of DjangoXBlockUserStateClient 2015-07-06 18:11:05 +00:00
Utkarsh
dac018f459 Adding dependency for edx-user-state-client 2015-06-25 03:10:50 +00:00
Calen Pennington
0f6ef44476 Don't pass in a user object to DjangoUserStateClient 2015-06-12 12:37:49 -04:00
Ali Mohammad
69772ef20e Convert access to StudentModuleHistory to use the UserStateClient API. 2015-06-12 12:37:34 -04:00
Calen Pennington
3e8631c214 Make the use of StudentModules explicit in variable names in user_state_client.py 2015-05-20 15:33:30 -04:00
Calen Pennington
7d2909c5b5 Add contracts to DjangoXBlockUserStateClient interface methods 2015-05-20 15:33:29 -04:00
Calen Pennington
2e06e592ca Use DjangoXBlockUserStateClient to implement UserStateCache 2015-05-20 15:33:29 -04:00
Calen Pennington
674b68b7e3 Add implementation of get_many and set_many to DjangoXBlockUserStateClient 2015-05-20 15:07:28 -04:00
Calen Pennington
1ec4ae7c26 Add more documentation to XBlockUserStateClient interface 2015-05-20 15:07:28 -04:00
Calen Pennington
4c3fb2d07e Enforce user-state only for StudentModule backend Client 2015-05-20 15:07:28 -04:00
Calen Pennington
c9dbd2c308 Add an empty implementation of XBlockUserStateClient backed by StudentModule 2015-05-20 15:07:27 -04:00