add in front end timings, devhub only to see if they work
This commit is contained in:
Родитель
f056d1ea06
Коммит
a72ac8764c
|
@ -4,6 +4,8 @@ from waffle.views import wafflejs
|
|||
from django.conf.urls.defaults import patterns, url, include
|
||||
from django.views.decorators.cache import never_cache
|
||||
|
||||
from django_statsd.urls import urlpatterns as statsd_patterns
|
||||
|
||||
from . import views
|
||||
|
||||
services_patterns = patterns('',
|
||||
|
@ -16,6 +18,7 @@ services_patterns = patterns('',
|
|||
name='amo.builder-pingback'),
|
||||
url('^graphite/(addons|dev|stage|apps-preview|apps-preview-dev)$',
|
||||
views.graphite, name='amo.graphite'),
|
||||
url('^timing/', include(statsd_patterns)),
|
||||
)
|
||||
|
||||
urlpatterns = patterns('',
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
{% block bodyattrs %}
|
||||
{% if addon %}data-default-locale="{{ addon.default_locale|lower }}"{% endif %}
|
||||
{% if waffle.flag('collect-timings') %}data-collect-timings="{{ url('django_statsd.views.record') }}"{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}{{ dev_page_title() }}{% endblock %}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
(function(exports) {
|
||||
"use strict";
|
||||
/*
|
||||
* A simpler boomerang: https://github.com/yahoo/boomerang that just
|
||||
* does navigation timing. Requires jquery.
|
||||
*
|
||||
* Copied from django-statsd.
|
||||
*/
|
||||
|
||||
exports.send = function(url) {
|
||||
/* Sends the timing data to the given URL */
|
||||
var perf = window.performance || window.msPerformance ||
|
||||
window.webkitPerformance || window.mozPerformance;
|
||||
if (perf) {
|
||||
$.post(url, {
|
||||
'window.performance.timing.navigationStart': perf.timing.navigationStart,
|
||||
'window.performance.timing.domComplete': perf.timing.domComplete,
|
||||
'window.performance.timing.domInteractive': perf.timing.domInteractive,
|
||||
'window.performance.timing.domLoading': perf.timing.domLoading,
|
||||
'window.performance.navigation.redirectCount': perf.navigation.redirectCount,
|
||||
'window.performance.navigation.type': perf.navigation.type,
|
||||
'client': 'stick'
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
})(typeof exports === 'undefined' ? (this.stick = {}) : exports);
|
|
@ -285,6 +285,10 @@ $(document).ready(function() {
|
|||
}
|
||||
});
|
||||
|
||||
var timings_url = $('body').attr('data-collect-timings');
|
||||
if (timings_url) {
|
||||
stick.send(timings_url);
|
||||
}
|
||||
});
|
||||
|
||||
function initUploadControls() {
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
INSERT INTO `waffle_flag`
|
||||
(name, everyone, percent, superusers, staff, authenticated, rollout, note)
|
||||
VALUES
|
||||
('collect-timings',1,NULL,0,0,1,0, 'Collect front end timings');
|
|
@ -741,6 +741,7 @@ MINIFY_BUNDLES = {
|
|||
'js/zamboni/devhub.js',
|
||||
'js/zamboni/validator.js',
|
||||
'js/zamboni/packager.js',
|
||||
'js/lib/stick.js',
|
||||
),
|
||||
'zamboni/editors': (
|
||||
'js/zamboni/editors.js',
|
||||
|
|
2
vendor
2
vendor
|
@ -1 +1 @@
|
|||
Subproject commit 3463f5888506bb9aca7dfdadcde5538ea3ca623d
|
||||
Subproject commit f37255efed835ccbcc208bfd4a60909efd3a61d2
|
Загрузка…
Ссылка в новой задаче