Skip to content

Commit

Permalink
Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyredondo committed Nov 26, 2024
1 parent 1b56e3e commit bb7539c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/TimeItSharp.Common/Configuration/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public Config()
ProcessFailedDataPoints = false;
ShowStdOutForFirstRun = false;
DebugMode = false;
AcceptableRelativeWidth = 0.01;
AcceptableRelativeWidth = 0.007;
ConfidenceLevel = 0.95;
MaximumDurationInMinutes = 45;
EvaluationInterval = 10;
Expand Down
4 changes: 2 additions & 2 deletions src/TimeItSharp.Common/ScenarioProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ await RunScenarioAsync(repeat.Count, index, scenario, TimeItPhase.ExtraRun, fals

private async Task<List<DataPoint>> RunScenarioAsync(int count, int index, Scenario scenario, TimeItPhase phase, bool checkShouldContinue, Stopwatch stopwatch, CancellationToken cancellationToken)
{
var minIterations = count / 3;
var minIterations = count / 2.5;
minIterations = minIterations < 10 ? 10 : minIterations;
var confidenceLevel = _configuration.ConfidenceLevel;
if (confidenceLevel is <= 0 or >= 1)
Expand Down Expand Up @@ -529,7 +529,7 @@ static double GetDuration(DataPoint point)
if ((durations.Count - minIterations) % _configuration.EvaluationInterval == 0)
{
var errorReduction = (previousRelativeWidth - relativeWidth) / previousRelativeWidth;
if (errorReduction < _configuration.MinimumErrorReduction)
if (errorReduction > 0 && errorReduction < _configuration.MinimumErrorReduction)
{
AnsiConsole.WriteLine();
AnsiConsole.MarkupLine(
Expand Down

0 comments on commit bb7539c

Please sign in to comment.