Skip to content

Commit

Permalink
Improvements (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyredondo authored Nov 26, 2024
1 parent 1b56e3e commit ed6d965
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>0.3.0</Version>
<Version>0.3.1</Version>
<Authors>Tony Redondo, Grégory Léocadie</Authors>
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
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
2 changes: 1 addition & 1 deletion src/TimeItSharp.Common/Exporters/ConsoleExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void Export(TimeitResult results)
var outliersValue = result.Outliers.Count > 0 ? $"{result.Outliers.Count} {{{Math.Round(result.OutliersThreshold, 3)}}}" : "0";
var rowList = new List<string>
{
$"[aqua underline]{result.Name}[/]",
$"[aqua underline]{result.Name} [[N={result.Count}]][/]",
$"{(result.Status == Status.Passed ? "[aqua]Passed" : "[red]Failed")}[/]",
$"[aqua]{Math.Round(Utils.FromNanosecondsToMilliseconds(result.Mean), 3)}ms[/]",
$"[aqua]{Math.Round(Utils.FromNanosecondsToMilliseconds(result.Stdev), 3)}ms[/]",
Expand Down
6 changes: 3 additions & 3 deletions src/TimeItSharp.Common/ScenarioProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ await RunScenarioAsync(repeat.Count, index, scenario, TimeItPhase.ExtraRun, fals
var scenarioResult = new ScenarioResult
{
Scenario = scenario,
Count = _configuration.Count,
Count = dataPoints.Count,
WarmUpCount = _configuration.WarmUpCount,
Data = dataPoints,
Durations = newDurations,
Expand Down 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 ed6d965

Please sign in to comment.