-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
175 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# The Mock Server | ||
|
||
## Overview | ||
|
||
The Mock Server is a simple server designed for receiving metric and trace data, providing a simulated endpoint for testing purposes. It listens on two separate ports: 8080 and 443. | ||
## Running the server | ||
This server is runs as a docker container to run this server: | ||
1. First build the docker container with | ||
```sh | ||
sudo docker build -t mockserver . | ||
``` | ||
2. Run the container by mapping the ports you would like to use, for example: | ||
```sh | ||
sudo docker run --name mockserver -d -p 8080:8080 -p 443:443 mockserver | ||
``` | ||
|
||
## How it Works | ||
### The Receiver | ||
|
||
The receiver component of the Mock Server operates on port 443. It is responsible for receiving messages and incrementing the transaction count. To simulate real-world conditions, there is a built-in 15ms latency between each received message. The data received can be sent to three possible routes: | ||
|
||
- **Check Receiver Status:** You can check if the receiver is alive by making a request to `/ping`. | ||
|
||
- **Send Data:** Use the `/put-data` route to send data. This route supports two sub-routes: | ||
- `/put-data/trace/v1`: Use this sub-route for sending trace data. | ||
- `/put-data/metrics`: Use this sub-route for sending metrics data. | ||
|
||
> [!Important] | ||
> Currently, both traces and metrics are handled in the same way. | ||
### The Verifier | ||
|
||
The verifier component can be accessed via a listener on port 8080. It provides information about the transactions, including: | ||
|
||
- **Transactions per Minute:** You can obtain the transactions per minute by making a request to `/tpm`. | ||
|
||
- **Transaction Count:** To check the total transaction count, use the `/check-data` route. | ||
|
||
- **Verifier Status:** Determine if the verification server is alive by sending a request to `/ping`. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.