npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

monitor-col

v1.0.0

Published

col

Downloads

2

Readme

错误监控搭建

错误类型

  1. 代码错误
  2. promise 错误
  3. 资源错误

需要收集的信息

  1. 用户 ID
  2. 错误发生时间
  3. 错误发生时应用版本信息
  4. 应用 ID
  5. 错误发生时的 url
  6. SDK 版本信息
  7. IP
  8. mac 地址
  9. 应用运行平台信息

上报方式

  • 自动上报
  • 手动上报
  1. 复写请求方式,比如xhr
  2. new Image()
  3. Navigator.sendBeacon

SDK 功能

  1. PV/UV
  2. 错误信息
  3. 行为信息
    1. 自定义上报
  4. 页面性能
  5. 错误行为录屏回放

枚举

errorType

src/base/baseConfig.js枚举描述

| 参数 | 项目 | 默认值 | | ------------- | ------------------------------------- | ------ | | js | js 错误,用来捕获语法,同步,异步错误 | 1 | | resource | 资源错误 | 2 | | promise | promise 错误 | 3 | | ajax | ajax 错误 | 4 | | console | console.error 错误 | 5 | | console_warn | console.warn 警告 | 6 | | console_info | console.info 提示 | 7 | | cross | cross 跨域错误 | 8 | | unknow_error | 未知错误 | 9 | | performance | 性能上报 | 10 | | network_speed | 网络上报 | 11 |

logtype

src/base/baseConfig.js枚举描述

| 参数 | 项目 | 默认值 | | ----- | ----------- | ------ | | error | 错误信息 | 1 | | warn | 警告信息 ⚠️ | 2 | | info | 日志信息 | 3 |

初始化入参

| 参数 | 说明 | 类型 | 必填 | 默认值 | 版本 | | ----------------- | --------------------- | ------- | ----- | ------ | ---- | | src | 上报地址 | String | true | - | | | appid | 应用 ID | Boolean | true | - | | | debug | 是否开启 debug | Boolean | false | - | | | devBaseUrl | 测试上报地址 | Boolean | false | - | | | log | 是否开启 console 上报 | Boolean | false | - | | | reportPerformance | 是否上报性能 | Boolean | false | - | | | disabled | 是否开启错误监控 | Boolean | true | - | |

上报信息

error stack

| 参数 | 说明 | | -------- | ----------------------------- | | category | 错误类型,查看errorType枚举 | | level | 错误等级,查看logtype枚举 | | msg | 错误描述信息 | | url | 错误发生的 url | | line | 错误行数 | | col | 错误列数 | | stack | 错误堆栈信息 | | time | 错误发生时间 | | device | 设备信息 |

用户信息

| 参数 | 说明 | | ------ | ------------ | | userId | 用户 ID | | ip | IP 地址 | | uuid | 访客唯一标识 |

业务相关

| 参数 | 说明 | | ----------- | -------- | | app_version | 应用版本 | | bdata | 业务数据 | | sdk_version | sdk 版本 |

device 信息

| 参数 | 说明 | | ------------ | -------------------------------------------------------- | | deviceType | 设备类型 | | OS | 操作系统 | | OSVersion | 操作系统版本 | | screenWidth | 屏幕宽度 | | screenHeight | 屏幕高度 | | language | 语言 | | netWork | 网络类型 | | orientation | 屏幕方向,横屏竖屏 | | browserInfo | 浏览器信息 | | fingerprint | 浏览器指纹 | | userAgent | 包含 appCodeName,appName,appVersion,language,platform 等 |

数据分析

基础数据

  1. PV
  2. UV
  3. 点击数

用户分析

  1. 用户活跃
  2. 用户留存
  3. 新老用户
  4. 平台
  5. 操作系统
  6. 地域
  7. 分辨率

自定义设置

  1. 权限管理
  2. 自定义埋点
  3. 自定义事件
  4. 自定义漏斗

综合数据

  1. 地域分布
  2. 在线时长-访问总时长,在线时长
  3. 来源分布-内链,外链,搜索引擎
  4. 按钮点击率-点击次数/pv
  5. 日访问趋势