Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/screebapp/benchmark-segment-subscription

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/screebapp/benchmark-segment-subscription

  • v0.0.0-20230227094226-6cb3739dc286
  • Source
  • Go
  • Socket score

Version published
Created
Source

Segment event producer for subscription developers

This project has been built for helping companies to create Segment connectors using subscriptions API (webhook). It allows to send a high volume of identity/group/alias/track/page/screen calls.

Segment subscriptions are documented here: https://segment.com/docs/partners/subscriptions/build-webhook/.

For load testing, just increase the concurrency and requests arguments.

Overview of event definition

Payload

  • API schema v2
  • 42k different identities (1 userId + 5 anonymousIds)
  • 50 property names
  • 200 event names
  • 100 screen names
  • 100% random URLs
  • 50% calls don't have userId
  • 20% calls don't have anonymousId
  • replay always false
  • sentAt < receivedAt < timestamp

During execution, properties sent into identify, group, track, page and screen calls will always have the same data type (number, string, datetime, boolean, object, array).

Ratio of calls per type

  • 20% identify
  • 5% group
  • 5% alias
  • 15% track
  • 30% page
  • 25% screen

Events will be triggered in a random order, and will be emitted from random users.

Auth

This tool only support basic token authentication.

Run

go get github.com/ScreebApp/segment-subscription-event-producer

go run github.com/ScreebApp/segment-subscription-event-producer \
	--requests 10000 \
	--concurrency 100 \
	--endpoint-url http://localhost:3000/webhook \
	--token xxxxxx

Contrib

go run *.go -n 100 -c 2 -e http://localhost:3000/webhook -t xxx

Todo

  • Add context payload (see "common fields" section in doc)
  • Collect and print response status code, at the end of execution
  • Collect and display response time, at the end of execution
  • Disable some events type from CLI
  • Display progress bar

FAQs

Package last updated on 27 Feb 2023

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