Skip to content

Commit

Permalink
Change speed and coverage calculation to be more representative of pe…
Browse files Browse the repository at this point in the history
…rformance
  • Loading branch information
integralfx committed Sep 27, 2019
1 parent 8753d42 commit 40a2441
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion MemTestHelper2/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

<TabItem Header="About">
<Grid Background="#252525" Margin="0">
<Label Content="Version 2.0.1" HorizontalAlignment="Center" Margin="180,70,180,104" VerticalAlignment="Center"/>
<Label Content="Version 2.0.2" HorizontalAlignment="Center" Margin="180,70,180,104" VerticalAlignment="Center"/>
<Label Content="Discord:" HorizontalAlignment="Center" Margin="138,98,248,76" VerticalAlignment="Center"/>
<TextBox x:Name="txtDiscord" HorizontalAlignment="Left" Margin="190,98,0,0" TextWrapping="Wrap"
Text="∫ntegral#7834" VerticalAlignment="Top" IsReadOnly="True" Width="89" PreviewMouseDoubleClick="txtDiscord_DoubleClick"/>
Expand Down
13 changes: 6 additions & 7 deletions MemTestHelper2/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class MainWindow : MetroWindow
{
private readonly int NUM_THREADS, MAX_THREADS;

// Interval (in ms) for coverage info list.
// Update interval (in ms) for coverage info list.
private const int UPDATE_INTERVAL = 200;

private MemTest[] memtests;
Expand All @@ -42,7 +42,7 @@ public MainWindow()
NUM_THREADS = Convert.ToInt32(Environment.GetEnvironmentVariable("NUMBER_OF_PROCESSORS"));
MAX_THREADS = NUM_THREADS * 4;
memtests = new MemTest[MAX_THREADS];
// index 0 stores the total
// Index 0 stores the total.
memtestInfo = new MemTestInfo[MAX_THREADS + 1];

InitCboThreads();
Expand Down Expand Up @@ -71,8 +71,7 @@ public MainWindow()
while (IsAnyMemTestStopping())
Thread.Sleep(100);

// TODO: figure out why total coverage is sometimes
// reporting 0.0 after stopping
// TODO: Figure out why total coverage is sometimes reporting 0.0 after stopping.
UpdateCoverageInfo(false);
});

Expand Down Expand Up @@ -378,8 +377,8 @@ private void InitLstCoverage()
{
for (var i = 0; i <= (int)cboThreads.SelectedItem; i++)
{
// First row is total.
memtestInfo[i] = new MemTestInfo(i == 0 ? "T" : i.ToString(), 0.0, 0);
// First row is average coverage.
memtestInfo[i] = new MemTestInfo(i == 0 ? "A" : i.ToString(), 0.0, 0);
}

lstCoverage.ItemsSource = memtestInfo;
Expand Down Expand Up @@ -773,7 +772,7 @@ private void UpdateCoverageInfo(bool shouldCheck = true)
lock (memtestInfo)
{
// Update the total coverage and errors.
memtestInfo[0].Coverage = totalCoverage;
memtestInfo[0].Coverage = totalCoverage / threads;
memtestInfo[0].Errors = totalErrors;
}

Expand Down

0 comments on commit 40a2441

Please sign in to comment.