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

dj-koa-reporter

v1.0.6

Published

http://confluence.daojia-inc.com/pages/viewpage.action?pageId=114149325

Downloads

4

Readme

中间层上报数据中间件,上报pv,uv,特定事件,用于浏览的监控和预警

文档

后端接口文档

后端接口文档 查看实时数据

使用文档

初始化

示例:

const { djReportorInit, djReporterStop } = require('dj-koa-reporter')
app.use(djReportorInit({
    businessId: 101,// 家政101
    clusterName: 'jz_fe_clean',// 集群名字
    host: 'jiazheng.daojia.com' // 域名
}, {
    env: djEnv === 'prod' ? 'prod' : 'test' // 环境:测试test,线上prod
}))

发送pv,uv统计

ctx.djReportor.sendPUV(data)

上报pv和uv数据,用于关键节点或接口的上报

  • data是个对象,字段有
  • biCookieId,字符串,必传
  • uri,字符串,必传
  • metricType,数字,pv/uv 缺省是1,非必传
  • uvKey,字符串,可选bi_cookieid openid imei,缺省是bi_cookieid,非必传

示例:

ctx.djReportor.sendPUV({
    biCookieId: '1234567890' || 'nocookied',// 没有时填一个缺省的字符串
    uri: '/page/foo/bar/'
})

事件上报

ctx.djReportor.sendEvtCnt(data)

  • 事件上报
  • @param {*} data 是个对象,字段有
  • key,字符串,标识事件的名称,等同于前端上报的event-id,必传

示例:

ctx.djReportor.sendEvtCnt({
    key:'event_enter_room'
})

数值类型事件上报

ctx.djReportor.sendEvtVal(data)

  • 数值类型事件上报,例如一次下单的订单金额
  • @param {*} data 是个对象,字段有
  • key,字符串,标识事件的名称,等同于前端上报的event-id,必传
  • value,字符串,标识数值大小,必传

示例:

ctx.djReportor.sendEvtVal({
    key: 'buy_some_goods',
    value: '100.99'
})