嵌入JS脚本显示网页的性能指标:justice.js

jphp1 9年前

justice.js实现嵌入JS脚本显示网页的性能指标。

Justice将在页面创建一个工具条,展示页面时间指标和一个流式fps仪表。

> DEMO <

Budget results are color coded based on budgets:

  • Over budget: Red
  • > 80% budget: Yellow
  • Under budget: Green

How to use

  <script type="text/javascript" src="justice.min.js"></script>    <script type="text/javascript">      Justice.init();    </script>

With options

  <script type="text/javascript" src="justice.min.js"></script>    <script type="text/javascript">      Justice.init({        metrics: {          pageLoad: { budget: 800 },          domComplete: { budget: 600 },          domInteractive: { budget: 400 },          requests: { budget: 6 }        },        showFPS: true,        chartType: 'spline'      });    </script>

项目主页:http://www.open-open.com/lib/view/home/1431403486732