|
|
|
@ -3,6 +3,7 @@ import { Tele } from 'nc-help';
|
|
|
|
|
|
|
|
|
|
const countMap = {}; |
|
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
const metrics = async (req: Request, c = 150) => { |
|
|
|
|
if (!req?.route?.path) return; |
|
|
|
|
const event = `a:api:${req.route.path}:${req.method}`; |
|
|
|
@ -13,12 +14,12 @@ const metrics = async (req: Request, c = 150) => {
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const metaApiMetrics = (req: Request, _res, next) => { |
|
|
|
|
metrics(req, 50).then(() => {}); |
|
|
|
|
const metaApiMetrics = (_req: Request, _res, next) => { |
|
|
|
|
// metrics(req, 50).then(() => {});
|
|
|
|
|
next(); |
|
|
|
|
}; |
|
|
|
|
export default (req: Request, _res, next) => { |
|
|
|
|
metrics(req).then(() => {}); |
|
|
|
|
export default (_req: Request, _res, next) => { |
|
|
|
|
// metrics(req).then(() => {});
|
|
|
|
|
next(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|