[go: up one dir, main page]

@tuia/koa-cat

0.0.4 • Public • Published

koa-cat

Nodejs项目接入Cat监控

Installation

yarn add @tuia/koa-cat

Documentation

Middleware

使用中间件,捕获所有请求的数据

const koa = require('koa');
const koaCat = require('@tuia/koa-cat');

const pkg = require('./package.json');

const app = new koa();

const cat = koaCat({
  appkey: pkg.name
});

app.use(cat.middleware());

API

使用API,可灵活自由埋点

const koa = require('koa');
const koaCat = require('@tuia/koa-cat');

const pkg = require('./package.json');

const app = new koa();

const cat = koaCat({
  appkey: pkg.name
});

const a = cat.threadCat.newTransaction('Context', 'A');
setTimeout(function() {
  a.complete();
}, 1000)

Readme

Keywords

Package Sidebar

Install

npm i @tuia/koa-cat

Weekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

1.08 MB

Total Files

10

Last publish

Collaborators

  • any-u
  • dinglh
  • candy_dd
  • wintersun97
  • tump
  • inuanfeng
  • zhoucheng
  • zhangmin173
  • aiduck
  • chao.zhou
  • babalk
  • leitingting
  • nbseven
  • linhao-vue
  • liusandy