https://github.com/resurfaceio/simulator
Simulate API calls and import into Resurface database
https://github.com/resurfaceio/simulator
java ndjson
Last synced: about 1 month ago
JSON representation
Simulate API calls and import into Resurface database
- Host: GitHub
- URL: https://github.com/resurfaceio/simulator
- Owner: resurfaceio
- License: apache-2.0
- Created: 2023-01-12T06:45:15.000Z (over 2 years ago)
- Default Branch: v3.6.x
- Last Pushed: 2024-11-14T16:19:59.000Z (6 months ago)
- Last Synced: 2025-02-05T07:49:16.878Z (3 months ago)
- Topics: java, ndjson
- Language: Java
- Homepage:
- Size: 134 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# resurfaceio-simulator
Simulate API calls and import into Resurface databaseThis open source Java utility generates simulated API calls (in [NDJSON format](https://resurface.io/json.html))
and sends these to a remote Resurface database. This command-line utility works with Resurface databases on Kubernetes or Docker.[](https://www.codefactor.io/repository/github/resurfaceio/simulator)
[](https://github.com/resurfaceio/simulator/blob/v3.6.x/CONTRIBUTING.md)
[](https://github.com/resurfaceio/simulator/blob/v3.6.x/LICENSE)
[](https://cloudsmith.io/~resurfaceio/repos/public/packages/)## Usage
Download executable jar:
```
wget https://dl.cloudsmith.io/public/resurfaceio/public/maven/io/resurface/resurfaceio-simulator/3.6.5/resurfaceio-simulator-3.6.5.jar
```Run with default dialect:
```
java -DWORKLOAD=Coinbroker -DHOST=localhost -DPORT=443 -DBATCH_SIZE=128 -DCLOCK_SKEW_DAYS=0 -DLIMIT_MESSAGES=0 -DLIMIT_MILLIS=0 -DSLEEP_PER_BATCH=0 -Xmx512M -jar resurfaceio-simulator-3.6.5.jar
```Run with API Connect dialect:
```
java -DDIALECT=ibm -DWORKLOAD=RestSmall2 -DHOST=localhost -DPORT=443 -DBATCH_SIZE=128 -DCLOCK_SKEW_DAYS=0 -DLIMIT_MESSAGES=0 -DLIMIT_MILLIS=0 -DSLEEP_PER_BATCH=0 -Xmx512M -jar resurfaceio-simulator-3.6.5.jar
```## Parameters
```
WORKLOAD: workload implementation class
HOST: machine name for remote database
PORT: network port for remote database (80 or 443 for Kubernetes, 7701 for Docker)BATCH_SIZE: default is '128', messages sent in a single POST
CLOCK_SKEW_DAYS: default is '0' (none), rewind virtual clock & advance faster
DIALECT: default is 'default' (Resurface format), set to 'ibm' for API Connect
LIMIT_MESSAGES: default is '0' (unlimited), quit after this many messages
LIMIT_MILLIS: default is '0' (unlimited), quit after this many milliseconds
SLEEP_PER_BATCH: default is '0' (none), pause in millis between batches
URL: override HOST and PORT with custom URL for remote database
```## Available Workloads
* **Minimum** - empty calls with method, url and response code only (12 byte/call)
* **Coinbroker** (default) - REST and GraphQL calls with injected failures and attacks (500 byte/call average)
* **RestSmall3** - REST calls with randomized url path, headers, and JSON bodies (2 KB/call average)
* **RestLarge3** - REST calls with randomized url path, headers, and JSON bodies (8 KB/call average)
* **ScrapingStuffing** - REST calls including scraping and stuffing attacks (X KB/call average)## Dependencies
* Java 17
* [datafaker-net/datafaker](https://github.com/datafaker-net/datafaker)
* [DiUS/java-faker](https://github.com/DiUS/java-faker)
* [resurfaceio/ndjson](https://github.com/resurfaceio/ndjson)## Installing with Maven
⚠️ We publish our official binaries on [CloudSmith](https://cloudsmith.io/~resurfaceio/repos/public/packages/) rather than Maven Central,
because CloudSmith is awesome and **free** for open-source projects.If you want to call this utility from your own Java application, add these sections to `pom.xml` to install:
```xml
io.resurface
resurfaceio-simulator
3.6.5```
```xml
resurfaceio-public
https://dl.cloudsmith.io/public/resurfaceio/public/maven/
true
always
```
---
© 2016-2024 Graylog, Inc.