https://github.com/screebapp/segment-subscription-event-producer
Segment event producer for subscription developers.
https://github.com/screebapp/segment-subscription-event-producer
api benchmark flooding hacktoberfest parallel segment subscription tracking webhook
Last synced: 3 months ago
JSON representation
Segment event producer for subscription developers.
- Host: GitHub
- URL: https://github.com/screebapp/segment-subscription-event-producer
- Owner: ScreebApp
- Created: 2021-10-05T22:44:30.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-02-27T09:42:36.000Z (over 3 years ago)
- Last Synced: 2024-06-21T11:00:31.827Z (almost 2 years ago)
- Topics: api, benchmark, flooding, hacktoberfest, parallel, segment, subscription, tracking, webhook
- Language: Go
- Homepage:
- Size: 6.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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/](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
```bash
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
```bash
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