1/** 2 * СкÑÐ¸Ð¿Ñ ÑбоÑа ÑÑаÑиÑÑики пÑоизводиÑелÑноÑÑи ÑÑÑаниÑÑ 3 * докÑменÑаÑÐ¸Ñ Ð¿Ð¾ api https://www.html5rocks.com/en/tutorials/webperformance/basics/ 4 * ÐонÑиг nginx Ð´Ð»Ñ ÑÐ¾Ñ ÑÐ°Ð½ÐµÐ½Ð¸Ñ Ð² лог 5 * log_format perfomance_stat '$time_local $host $http_referer $perfomance_data'; 6 7 location /p_monitor/{ 8 set $perfomance_data "$arg_redirect $arg_dns $arg_connection $arg_request $arg_response $arg_domLoad $arg_domInteractive $arg_totalRequestTime"; 9 access_log /var/log/perfomance_stat.log perfomance_stat; 10 return 200; 11 } 12 */ 13 14(function (jQuery) { 15 var $ = jQuery, 16 start = 0, 17 timing = {}, 18 data = { 19 redirect:0, 20 fetchStart:0, 21 dns:0, 22 connection:0, 23 request:0, 24 response:0, 25 domLoad:0, 26 domInteractive:0, 27 totalRequestTime:0 28 }; 29 30 if (performance !== undefined) { 31 window.onload = function () { 32 timing = performance.timing; 33 start = timing.navigationStart; 34 data.redirect = timing.redirectEnd - timing.redirectStart; 35 data.fetchStart = timing.fetchStart - start; 36 data.dns = timing.domainLookupEnd - timing.domainLookupStart; 37 data.connection = timing.domainLookupStart - timing.connectStart; 38 data.request = timing.responseStart - timing.requestStart; 39 data.response = timing.responseEnd - timing.responseStart; 40 data.domLoad = timing.domComplete - timing.domLoading; 41 data.domInteractive = timing.domInteractive - start; 42 data.totalRequestTime = timing.domComplete-start; 43 44 $.get( 45 '/p_monitor/', 46 data, 47 'json' 48 ); 49 } 50 } 51 52})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.