
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
console-agent
Advanced tools
$ npm i -S console-agent
.kagentrc.js
module.exports = {
"server": "http://127.0.0.1:7009", // connection 模块暴露的地址
"appid": "5", // appid
"secret": "84fe6510-1340-11e9-94fa-d9a76a880c81", // secret
"cluster": "localjd" // 集群名
}
$ node index.js --require ./node_modules/console-agent/index.js
const agent = require('console-agent');
Leader/Follower
模型建立以及与 Connection
的对接是异步过程。本地埋探针的操作应当使用 ready
函数确保流程启动完毕。
const getMysqlConnections = () => {};
agent.ready(() => {
agent.guage('connections', () => {
return getMysqlConnections()
})
});
const getMysqlConnections = () => {};
agent.guage('connections', () => {
return getMysqlConnections()
})
该操作用来统计某一时刻的数量,常用于统计连接数
const redisCounter = agent.counter('redis');
redisCounter.inc();
redisCounter.dec();
该操作用来统计某一操作的数据分布,如 MIN
/MAX
/AVG
const redisRT = agent.histogram('redis-rt');
redisRT.update(35);
redisRT.update(34);
redisRT.update(33);
该操作用来统计某一操作的触发频率,如 QPS
const redisQPS = agent.meter('redis-qps');
redisRT.mark();
redisRT.mark();
redisRT.mark();
timer
是 meter
与 histogram
的封装。
const http = require('http');
http.createServer((req, res) => {
const end = res.end;
const url = URL.parse(req.url)
const path = url.pathname;
const timer = kagent.timer('http');
timer.start();
res.end = function(...args1) {
timer.close();
kagent.meter('app/url/' + res.statusCode + '/' + path).mark();
return Reflect.apply(end, this, args1);
}
});
MIT
FAQs
console-agent <img src
We found that console-agent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.