diff --git a/DotNetPerfAnalysisIntro/README.md b/DotNetPerfAnalysisIntro/README.md index a008c2a..b529546 100644 --- a/DotNetPerfAnalysisIntro/README.md +++ b/DotNetPerfAnalysisIntro/README.md @@ -4,3 +4,16 @@ This sample project aims to demonstrate how to analyze and improve the performan service using Visual Studio profilers. In this exercise we attempt to improve the latency and throughput of a simple API. + +To run the load test: + +```sh +cd load-tests +k6 run --vus --duration ./basic.js +``` + +e.g. + +```sh +k6 run --vus 200 --duration 30s ./basic.js +``` diff --git a/DotNetPerfAnalysisIntro/SampleApi/DataReader.cs b/DotNetPerfAnalysisIntro/SampleApi/DataReader.cs index 6c12e49..4d9d028 100644 --- a/DotNetPerfAnalysisIntro/SampleApi/DataReader.cs +++ b/DotNetPerfAnalysisIntro/SampleApi/DataReader.cs @@ -24,7 +24,7 @@ public static async Task> ReadDataAsync(Stream input) } else if (word.StartsWith("temp:")) { - temperature = double.Parse(word.Split(':')[1]); + double.TryParse(word.Split(':')[1], out temperature); } }