Ruby 下的實時用戶監控

今日在主站進行 Dribbble 模版仿製的時候,發現其頭部出現了以前未曾見過的 Script 代碼

<script type=”text/javascript”>var NREUMQ=NREUMQ||[];NREUMQ.push([“mark”,”firstbyte”,new Date().getTime()]);</script>

於是谷歌一下 才得知這是一項新的技術,用於監測站點處理用戶請求時的耗時與一些關鍵事情的記錄。

這串代碼位於 <Head> 內,並且需要在底部配上以下代碼才能運行:

<script type=”text/javascript”>if (!NREUMQ.f) { NREUMQ.f=function() {
NREUMQ.push([“load”,new Date().getTime()]);
var e=document.createElement(“script”);
e.type=”text/javascript”;e.async=true;e.src=”https://d1ros97qkrwjf5.cloudfront.net/42/eum/rum.js”;
document.body.appendChild(e);
if(NREUMQ.a)NREUMQ.a();
};
NREUMQ.a=window.onload;window.onload=NREUMQ.f;
};
NREUMQ.push([“nrfj”,”beacon-1.newrelic.com”,”7840d0c136″,108602,”Jg1bREUOClsARUpHABcHUF5ECQlDFhgMWgcAGg==”,0,133,new Date().getTime(),””,””,””,””,””])</script>

Leave a reply:

Your email address will not be published.

Site Footer