October 2013
Intermediate to advanced
368 pages
9h 20m
English
We have a performance challenge. Our product owner indicates that we expect a large volume of users. The initial release should support tracking 50,000 users simultaneously.
We write a test that emulates scaling up to large numbers of users.
| c9/3/GeoServerTest.cpp | |
| | TEST(AGeoServer_UsersInBox, HandlesLargeNumbersOfUsers) { |
| | Location anotherLocation{aUserLocation.go(10, West)}; |
| | const unsigned int lots {500000}; |
| | for (unsigned int i{0}; i < lots; i++) { |
| | string user{"user" + to_string(i)}; |
| | server.track(user); |
| | server.updateLocation(user, anotherLocation); |
| | } |
| | |
| | auto users = server.usersInBox(aUser, Width, Height); |
| | CHECK_EQUAL(lots, users.size()); |
| | } |
When we run our tests, we notice a pause ...