@aligov/components-arms-report

arms report api

Usage no npm install needed!

<script type="module">
  import aligovComponentsArmsReport from 'https://cdn.skypack.dev/@aligov/components-arms-report';
</script>

README

@aligov/arms-report

ARMS 前端监控 的上报模块(不带 ARMS SDK),用于简化 api 在页面中的使用。

安装

$ tnpm i @aligov/arms-report -S

使用

const report = require('@aligov/arms-report');

// report api call status, success or not
report.api(
  apiName,
  successOrFail,
  spendTimeInMilliseconds,
  optionalApiStatusCode,
  optionalMsg
);

// report error information
report.error(errorInstance, optionalErrorPos);

// call retCode api method, argsList are retCode api args that put into list as it's order
report.call(method, argsList);

// setPage
report.setPage(pageName);

// sum
report.sum(key, value);
// avg
report.avg(key, value);

// setConfig info
report.setConfig(configObj);

参考

开发/贡献

  • Checkout 仓库
  • 开新分支
  • 修改、提交以及 push
    • 注意:该模块没使用 babel 来转换代码,故需要使用 ES5 的语法,否则,在项目中被引用且 webpack babel 时 ignore 了 node_modules,会导致打包报错
  • (Master) 合并,更新版本并使用 tnpm publish 来发布到 tnpm