Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
4d6c47c4
Commit
4d6c47c4
authored
Mar 27, 2015
by
Christine Lytwynec
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7503 from edx/clytwynec/lms-onload-beacon
onload performance beacon for LMS pages
parents
70819203
06b3110e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
1 deletions
+39
-1
lms/envs/aws.py
+1
-0
lms/envs/common.py
+8
-1
lms/templates/main.html
+30
-0
No files found.
lms/envs/aws.py
View file @
4d6c47c4
...
...
@@ -555,6 +555,7 @@ XBLOCK_SETTINGS = ENV_TOKENS.get('XBLOCK_SETTINGS', {})
##### CDN EXPERIMENT/MONITORING FLAGS #####
CDN_VIDEO_URLS
=
ENV_TOKENS
.
get
(
'CDN_VIDEO_URLS'
,
CDN_VIDEO_URLS
)
ONLOAD_BEACON_SAMPLE_RATE
=
ENV_TOKENS
.
get
(
'ONLOAD_BEACON_SAMPLE_RATE'
,
ONLOAD_BEACON_SAMPLE_RATE
)
##### ECOMMERCE API CONFIGURATION SETTINGS #####
ECOMMERCE_API_URL
=
ENV_TOKENS
.
get
(
'ECOMMERCE_API_URL'
,
ECOMMERCE_API_URL
)
...
...
lms/envs/common.py
View file @
4d6c47c4
...
...
@@ -359,6 +359,9 @@ FEATURES = {
# enable beacons for video timing statistics
'ENABLE_VIDEO_BEACON'
:
False
,
# enable beacons for lms onload event statistics
'ENABLE_ONLOAD_BEACON'
:
False
,
# Certificates Web/HTML Views
'CERTIFICATES_HTML_VIEW'
:
False
,
}
...
...
@@ -2151,9 +2154,13 @@ SEARCH_ENGINE = None
# Use the LMS specific result processor
SEARCH_RESULT_PROCESSOR
=
"lms.lib.courseware_search.lms_result_processor.LmsSearchResultProcessor"
##### CDN EXPERIMENT/MONITORING FLAGS #####
### PERFORMANCE EXPERIMENT SETTINGS ###
# CDN experiment/monitoring flags
CDN_VIDEO_URLS
=
{}
# Page onload event sampling rate (min 0.0, max 1.0)
ONLOAD_BEACON_SAMPLE_RATE
=
0.0
# The configuration visibility of account fields.
ACCOUNT_VISIBILITY_CONFIGURATION
=
{
# Default visibility level for accounts without a specified value
...
...
lms/templates/main.html
View file @
4d6c47c4
...
...
@@ -186,3 +186,33 @@
)
) if course_id and enrollment_action else ""
}
</
%
def>
# Performance beacon for onload times
% if settings.FEATURES.get('ENABLE_ONLOAD_BEACON', False):
<script>
(
function
()
{
var
sample_rate
=
$
{
settings
.
ONLOAD_BEACON_SAMPLE_RATE
};
var
roll
=
Math
.
floor
(
Math
.
random
()
*
100
)
/
100
;
var
onloadBeaconSent
=
false
;
if
(
roll
<
sample_rate
){
$
(
window
).
load
(
function
()
{
setTimeout
(
function
(){
var
t
=
window
.
performance
.
timing
;
var
data
=
{
event
:
"onload"
,
value
:
t
.
loadEventEnd
-
t
.
navigationStart
,
page
:
window
.
location
.
href
,
};
if
(
!
onloadBeaconSent
)
{
$
.
ajax
({
method
:
"POST"
,
url
:
"/performance"
,
data
:
data
});
}
onloadBeaconSent
=
true
;
},
0
);
});
}
}());
</script>
% endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment