Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
zw-service-monitor
Advanced tools
政务方向,服务异常监控
npm i zw-service-monitor --save
直接在 app.js 中引入(zw-service-monitor会重写 request)
import 'zw-service-monitor';
import {sendSuccessLog, sendFailLog} = from 'zw-service-monitor';
参数 | 类型 | 说明 | |
---|---|---|---|
params | Object | 业务发送接口请求的参数 | |
url | String | 业务接口地址 | |
data | Number | 业务请求的参数 | |
oldDate | Number | 业务请求的时间戳 |
参数 | 类型 | 说明 | |
---|---|---|---|
params | Object | 业务发送接口请求的参数 | |
url | String | 业务接口地址 | |
data | Number | 业务请求的参数 | |
oldDate | Number | 业务请求的时间戳 | |
err | Object | 业务请求失败的报错信息 |
// 引入
import {sendSuccessLog, sendFailLog} = from 'zw-service-monitor';
function request() {
const url = 'https://sfc.baidu.com/shopping/nianhuo/bimai?timestamp=10001';
const data = {
tabname: '美食酒水'
};
const oldDate = +new Date();
// 发起请求
swan.request({
url,
data,
method: 'POST',
success: res => {
// 请求错误
if (res && res.statusCode !== 200) {
res.errCode = res.statusCode;
// 发送错误日志
sendFailLog({
url,
data
}, oldDate, res);
} else {
// 业务接口状态
if (+res.data.errno === 0) {
// 发送成功日志
sendSuccessLog({
url,
data
}, oldDate)
} else {
// 发送错误日志
sendFailLog({
url,
data
}, oldDate, res);
}
}
},
fail: err => {
// 发送错误日志
sendFailLog({
url,
data
}, oldDate, err);
}
});
}
4、 观察工具中以下接口请求是否正常
接口地址:https://minipro.baidu.com/ma/zw/monitor/logreport
请求成功:
确认该接口的 form data 的 status 是 success 还是 fail,success 代表业务接口正常,fail 代表业务接口异常
FAQs
The npm package zw-service-monitor receives a total of 20 weekly downloads. As such, zw-service-monitor popularity was classified as not popular.
We found that zw-service-monitor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.