Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
swagger-stats
Advanced tools
Collect and monitor REST API statistics in node app, based on Swagger API specification
Collect and monitor REST API statistics in node express app based on Swagger API specification or express routes
npm install swagger-stats --save
var swStats = require('swagger-stats');
var app = module.exports = express();
var swaggerSpec = require('swagger.json');
// Enable swagger-stats middleware
app.use(swStats.getMiddleware({
name: 'swagger-stats-testapp',
version: '0.70.1',
swaggerSpec:swaggerSpec
}));
See /examples
$ curl http://<your app host:port>/swagger-stats/stats
{
"startts": 1495174617959,
"all": {
"requests": 247,
"responses": 246,
"errors": 89,
"info": 0,
"success": 139,
"redirect": 18,
"client_error": 68,
"server_error": 21,
"total_time": 12601,
"max_time": 100,
"avg_time": 51.016194331983804,
"total_req_clength": 12760,
"max_req_clength": 209,
"avg_req_clength": 51,
"total_res_clength": 25361,
"max_res_clength": 200,
"avg_res_clength": 102,
"req_rate": 1.8788726763941634,
"err_rate": 0.6715970417749351
},
"name": "swagger-stats-testapp",
"version": "0.70.1",
"nodehostname": "hostname",
"nodename": "node-1",
"nodeaddress": "127.0.0.1"
}
Try also:
$ curl http://<your app host:port>/swagger-stats/stats?fields=method
$ curl http://<your app host:port>/swagger-stats/stats?fields=timeline
$ curl http://<your app host:port>/swagger-stats/stats?fields=lasterrors
$ curl http://<your app host:port>/swagger-stats/stats?fields=longestreq
$ curl http://<your app host:port>/swagger-stats/stats?fields=apidefs
$ curl http://<your app host:port>/swagger-stats/stats?fields=apistats
$ curl http://<your app host:port>/swagger-stats/stats?fields=errors
$ curl http://<your app host:port>/swagger-stats/stats?fields=all
Or combination:
$ curl http://<your app host:port>/swagger-stats/stats?fields=method,timeline
$ curl http://<your app host:port>/swagger-stats/stats?fields=all
$ curl http://<your app host:port>/swagger-stats/stats?fields=*
http://<your app host:port>/swagger-stats/ui
FAQs
API Telemetry and APM. Trace API calls and Monitor API performance, health and usage statistics in Node.js Microservices, based on express routes and Swagger (Open API) specification
The npm package swagger-stats receives a total of 17,844 weekly downloads. As such, swagger-stats popularity was classified as popular.
We found that swagger-stats 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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.