A simple web server to simulate the resource required to run the EAES API and retrieve student results from https://eaes.et/.
- Seed the PostgreSQL database with sample data.
- Start the web server.
- Perform a performance test using a tool like
hey
.
Before running the web server, make sure to seed the PostgreSQL database with sample data. You can use the provided seed.go
file to insert random data into the results
table.
cd script
go run seed.go
To start the web server, run the following command:
go run main.go
The server will start listening on http://localhost:8080
.
To perform a performance test, you can use the hey
CLI tool. Here's an example command to send 100,000 requests with 10,000 concurrent connections:
hey -n 100000 -c 10000 http://localhost:8080/result?id=1
Make sure to replace http://localhost:8080/result?id=1
with the actual URL of your endpoint.
An example performance testing result is available in the scripts/performance_result.txt
file in the repository. You can refer to this file to see the performance metrics and results obtained during the test.
Please note that this is a simulated server and does not actually connect to the EAES API. It is intended for testing and demonstration purposes only.
Make sure you have PostgreSQL installed and running, and update the database connection details in the config.go
file.