Browse Source

增加阿里的前端监控

Michael Wang 6 years ago
parent
commit
f8e41e52a7
1 changed files with 15 additions and 0 deletions
  1. 15 0
      public/index.html

+ 15 - 0
public/index.html

@@ -16,6 +16,21 @@
       delete window.module;
     }
   </script>
+  <script src="https://ecs.qmth.com.cn:8878/electron-config/ali-arms.js"></script>
+  <script>
+    if (window.__sampleRateInt) { // from above js file
+      startAliArms(window.__sampleRateInt);
+    } else {
+      startAliArms(100);
+    }
+    function startAliArms(sampleRate) {
+      console.log('ARMS sample: ' + sampleRate);
+      !(function (c, b, d, a) {
+        c[a] || (c[a] = {}); c[a].config = { pid: "hworw@48e147d26fd751a", enableSPA: true, sample: 10, sendResource: true, imgUrl: "https://arms-retcode.aliyuncs.com/r.png?" };
+        with (b) with (body) with (insertBefore(createElement("script"), firstChild)) setAttribute("crossorigin", "", src = d)
+      })(window, document, "https://retcode.alicdn.com/retcode/bl.js", "__bl");
+    }
+  </script>
 </head>
 
 <body>