New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/vadimgossip/tcpbsonserverreqgenerator

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/vadimgossip/tcpbsonserverreqgenerator

  • v0.0.0-20221010134117-e971904c73ab
  • Source
  • Go
  • Socket score

Version published
Created
Source

BSON request generator Allows to generate N requests per second for M seconds. Both parameters are set in the config.

Example:

requestGenerator:
    routePerSec: 100
    workTimeSec: 5

Query example:

type RouteRequest struct {
  RequestType   string         `bson:"requestType"`
  MsgId	        int            `bson:"msgId"`
  SendTime      time.Time      `bson:"sendTime"`
  RouteDuration time.Duration  `bson:"routeDur"`
}

The RouteDuration parameter is needed to emulate somehow working on the server side.

Server example: https://github.com/VadimGossip/tcpBsonServerExample

Server response example:

type RouteResponse struct {
  Err            string     `bson:"err,omitempty"`
  SendTime       time.Time  `bson:"sendTime,omitempty"`
  RouteStartTime time.Time  `bson:"routeBegin,omitempty"`
  RouteEndTime   time.Time  `bson:"routeEnd,omitempty"`
}

When the program finishes, it generates a response of the form:

config {RoutePerSec:100 WorkTimeSec:5}
Route Request Sent 500
Route Histogramm map[200:500]
Route Request Avg Answer Duration 109.552003ms
Route Request Min Answer Duration 106.7175ms
Route Request Max Answer Duration 127.097ms

Histogram Step 100ms

FAQs

Package last updated on 10 Oct 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc