Compare commits
4 Commits
0241fcc579
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a25bc385dd | |||
| ea96dd98e2 | |||
| 3b011affbb | |||
| f52cec4cf1 |
@@ -0,0 +1,3 @@
|
|||||||
|
/node_modules
|
||||||
|
/dist
|
||||||
|
/package-lock.json
|
||||||
@@ -60,13 +60,13 @@ Your task is to extract the high-throughput ticket purchasing component (inspire
|
|||||||
|
|
||||||
Simulate high load using a tool like [autocannon](https://github.com/mcollina/autocannon) or [wrk](https://github.com/wg/wrk). For example, to simulate 2000 concurrent connections on event 1:
|
Simulate high load using a tool like [autocannon](https://github.com/mcollina/autocannon) or [wrk](https://github.com/wg/wrk). For example, to simulate 2000 concurrent connections on event 1:
|
||||||
|
|
||||||
npx autocannon -c 2000 -d 30 http://localhost:3000/buy/1
|
npx autocannon -c 2000 -d 30 http://localhost:3049/buy/1
|
||||||
|
|
||||||
### Metrics
|
### Metrics
|
||||||
|
|
||||||
Access real-time service metrics at:
|
Access real-time service metrics at:
|
||||||
|
|
||||||
http://localhost:3000/metrics
|
http://localhost:3049/metrics
|
||||||
|
|
||||||
These metrics should include data on tickets sold, remaining tickets per event, and any instances where the fallback mechanism was activated.
|
These metrics should include data on tickets sold, remaining tickets per event, and any instances where the fallback mechanism was activated.
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -11,7 +11,7 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"express": "^4.18.2",
|
"express": "^4.21.2",
|
||||||
"redis": "^4.6.5"
|
"redis": "^4.7.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ const express = require("express");
|
|||||||
const redis = require("redis");
|
const redis = require("redis");
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const port = process.env.PORT || 3000;
|
const port = process.env.PORT || 3049;
|
||||||
|
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user