0.0.4 • Published 5 years ago

@tuia/koa-cat v0.0.4

Weekly downloads
1
License
MIT
Repository
gitlab
Last release
5 years ago

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)
0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago