-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from obeliss-nlesc/feature/server_testing
Feature/server testing
- Loading branch information
Showing
8 changed files
with
90 additions
and
61 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
## Load test server | ||
|
||
Run the server | ||
|
||
```bash | ||
npm run dev-newDb | ||
``` | ||
|
||
Run testing script with N users | ||
|
||
```bash | ||
node test_user_flow.js N | ||
``` |
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,34 @@ | ||
const userdb = require("../data/userdb.json") | ||
|
||
const maxUsers = 999 | ||
|
||
const userIds = [] | ||
|
||
for (let i = 0; i < maxUsers; i++) { | ||
const base = 1000 | ||
userIds.push(base + i) | ||
} | ||
|
||
usersInDb = userdb.map((u) => { | ||
return u.userId | ||
}) | ||
|
||
const A = new Set(userIds) | ||
const B = new Set(usersInDb) | ||
|
||
const symmetricDifference = (setA, setB) => { | ||
const difference = new Set([...setA].filter((x) => !setB.has(x))) | ||
;[...setB].forEach((x) => { | ||
if (!setA.has(x)) { | ||
difference.add(x) | ||
} | ||
}) | ||
return difference | ||
} | ||
|
||
// Example usage | ||
// const set1 = new Set([1, 2, 3, 4]); | ||
// const set2 = new Set([3, 4, 5, 6]); | ||
|
||
const symDiff = symmetricDifference(A, B) | ||
console.log(symDiff) // Output: Set { 1, 2, 5, 6 } |
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
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