Skip to content

Commit

Permalink
Merge pull request #374 from /issues/373-Benchmark0mbits
Browse files Browse the repository at this point in the history
  • Loading branch information
tpill90 authored Aug 3, 2024
2 parents 77bec93 + b80ce52 commit 05603ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
15 changes: 12 additions & 3 deletions SteamPrefill/CliCommands/Benchmark/BenchmarkModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,18 @@ public sealed class BenchmarkWorkload

public List<QueuedRequest> AllQueuedRequests => QueuedAppsList.SelectMany(e => e.QueuedRequests).ToList();

private ByteSize _totalDownloadSize;
public ByteSize TotalDownloadSize => _totalDownloadSize;
public string TotalDownloadSizeFormatted => _totalDownloadSize.ToDecimalString();
private ByteSize? _totalDownloadSize;
public ByteSize TotalDownloadSize
{
get
{
if (_totalDownloadSize == null)
{
_totalDownloadSize = ByteSize.FromBytes(QueuedAppsList.Sum(e => e.TotalBytes));
}
return _totalDownloadSize.Value;
}
}

public long TotalFiles => QueuedAppsList.Sum(e => e.FileCount);
public string TotalFilesFormatted => TotalFiles.ToString("n0");
Expand Down
3 changes: 2 additions & 1 deletion SteamPrefill/SteamManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,10 @@ private static void CheckBenchmarkWorkloadSize(BenchmarkWorkload generatedWorklo
table.AddColumn("");

// Adding message rows
var totalDownloadSize = generatedWorkload.TotalDownloadSize;
table.AddRow(LightYellow($"{new string(' ', 40)}!!!!!! Warning !!!!!!"));
table.AddEmptyRow();
table.AddRow($"The generated workload size of {Magenta(generatedWorkload.TotalDownloadSizeFormatted)} " +
table.AddRow($"The generated workload size of {Magenta(totalDownloadSize.ToBinaryString())} " +
$"is smaller than the total system memory of {LightYellow(systemMemory.ToDecimalString())}.");
table.AddRow("Linux will cache files that it reads in system memory to improve performance of frequently used files,");
table.AddRow("however this benchmark is typically used to test disk IO performance.");
Expand Down

0 comments on commit 05603ed

Please sign in to comment.