O'Reilly logo

Dart: Scalable Application Development by Ivo Balbaert, Sergey Akopkokhyants, Davy Mitchell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Load testing revisited

The initial load testing application was rather limited, and though of use, it did not give a realistic picture with so many requests thrown at once at the server application without waiting for a response.

Updating the load tester

The new version of the load testing application will make a single HTTP call and await the result before calling the next. This takes place in the main.dart source file. Note that the main function itself in now marked as async. The await command is used in the calling loop of the main function, as follows:

main() async { print("Starting..."); var url = "http://127.0.0.1:8080/index.html"; var hc = new HttpClient(); var watch = new Stopwatch(); int attemptedRequests = 200; print("Starting testing..."); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required