Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Test Impact Analysis #154

Draft
wants to merge 189 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
189 commits
Select commit Hold shift + click to select a range
065c418
zmq powered gui
mpdeimos Sep 28, 2020
2385d65
retarget vc projects
mpdeimos Sep 28, 2020
a1e3e9f
codemaid
mpdeimos Sep 28, 2020
e0d81b1
add ZMQ, first concept of one-way profiler communication
mpdeimos Sep 29, 2020
a64c664
add testcase for one-way profiler communication
mpdeimos Sep 29, 2020
f0c0be3
rename gui
mpdeimos Sep 30, 2020
5befda8
add profiler commons project and use in test
mpdeimos Sep 30, 2020
95d8074
Test infra: use .net ZMQ and native ZMQ
mpdeimos Nov 24, 2020
59af32f
Extend Profiler Testee with an interactive mode
mpdeimos Nov 25, 2020
2f6f80d
Add publisher socket to C# IPC implementation
mpdeimos Nov 25, 2020
5c63ba7
Wire subscribe socket in C++ IPC
mpdeimos Nov 25, 2020
d40729c
write function infos to log on test case switch
mpdeimos Nov 25, 2020
1d016b9
Real TIA method call profiling
mpdeimos Dec 1, 2020
ea2fa00
Refactor tests
mpdeimos Dec 2, 2020
2f2e923
No locking until IPC is started
mpdeimos Dec 14, 2020
3022397
Use NetMQ-native threading
mpdeimos Dec 14, 2020
a5d3519
compiler profiler testee with native bitness and as x86, x64
mpdeimos Dec 14, 2020
aee3e91
parameterize tia tests as x64 and x86
mpdeimos Dec 14, 2020
1fbf7e7
test start ipc after app (not working yet)
mpdeimos Jan 22, 2021
82ea47f
commander rework
mpdeimos Jan 22, 2021
3874d31
simplified commander
mpdeimos Jan 22, 2021
519a256
multipart tia start/end
mpdeimos Jan 26, 2021
b421dc6
escaping of characters
mpdeimos Jan 26, 2021
0fec463
store test execution result
mpdeimos Jan 26, 2021
0bf704e
disable mscorlib profiling for TIA
mpdeimos Jan 26, 2021
8d868f8
fix for default socket
mpdeimos Jan 29, 2021
b256b52
Wrap coverage data in report class.
salsolatragus Nov 24, 2020
efa1a83
Write testwise coverage report.
salsolatragus Nov 27, 2020
6f639cf
Merge TraceFile and ParsedTraceFile classes.
salsolatragus Jan 31, 2021
266c6c0
Hide internal data of TraceFile.
salsolatragus Jan 31, 2021
5f9ad5e
Make names consistent.
salsolatragus Jan 31, 2021
c379efa
Ignores method references from unkown assemblies.
salsolatragus Jan 31, 2021
f83ce26
Improve some names.
salsolatragus Jan 31, 2021
985a4a4
Split testwise report and separate conversion from files.
salsolatragus Jan 31, 2021
9abbb23
Generate aggregated report.
salsolatragus Jan 31, 2021
1fcbe09
Introduce ICoverageReport abstraction.
salsolatragus Jan 31, 2021
abd3188
Tests simple report output.
salsolatragus Jan 31, 2021
d30faf1
Tests aggregated trace.
salsolatragus Jan 31, 2021
702224b
Test testwise report contents.
salsolatragus Jan 31, 2021
0769fc1
Remove obsolete method.
salsolatragus Jan 31, 2021
9a7a5f4
Simplify tests.
salsolatragus Jan 31, 2021
0bb95e6
Test generating testwise report.
salsolatragus Feb 1, 2021
760c7b9
Merge SimpleCoverageReport and LineCoverageReport.
salsolatragus Feb 1, 2021
2e0df40
Remove unused import.
salsolatragus Feb 1, 2021
9784045
Remove obsolete class.
salsolatragus Feb 1, 2021
7d2353f
Cleanup testwise report model.
salsolatragus Feb 1, 2021
6ef6870
Simplify creation of testwise report.
salsolatragus Feb 1, 2021
4cd2c43
Merge testwise reports with different tests.
salsolatragus Feb 1, 2021
2fba176
Merge testwise reports.
salsolatragus Feb 1, 2021
dffe644
Send report format to Teamscale.
salsolatragus Feb 1, 2021
d297d3b
Move simple report to own namespace.
salsolatragus Feb 1, 2021
9de811b
Serialize testwise report.
salsolatragus Feb 1, 2021
5c1df8d
Test parsing jitted, inlined, and called events.
salsolatragus Feb 2, 2021
458b210
Assume tests always start.
salsolatragus Feb 2, 2021
54b99b5
Consider test without end.
salsolatragus Feb 2, 2021
4057fab
Add no-test coverage only if any.
salsolatragus Feb 2, 2021
6a8c035
Fix test result labels.
salsolatragus Feb 2, 2021
73b2bd3
Keep non-test coverage.
salsolatragus Feb 2, 2021
4d232e2
cache latest test runs
mpdeimos Feb 2, 2021
3a32c3c
Merge test metadata.
salsolatragus Feb 2, 2021
77888f4
Simplify archiving API.
salsolatragus Feb 2, 2021
2e35d47
Shorten an expression.
salsolatragus Feb 2, 2021
6f74a98
Fix stupid merge error.
salsolatragus Feb 2, 2021
059a5e5
test timing fix
mpdeimos Feb 3, 2021
7563980
error logging
mpdeimos Feb 12, 2021
e13ce46
test name validation
mpdeimos Feb 12, 2021
083ea6d
Extract Tia test baseclass.
salsolatragus Feb 19, 2021
f850e52
Abstract test setup.
salsolatragus Feb 19, 2021
515f5c9
Restructure test infrastructure.
salsolatragus Feb 23, 2021
1a4fb06
Remove TiaTestee.
salsolatragus Feb 23, 2021
c07b91b
Simplify testee.
salsolatragus Feb 23, 2021
ee83cde
Reduce visibility.
salsolatragus Feb 23, 2021
8017b25
Specify bitness on testee rather than profiler.
salsolatragus Feb 24, 2021
5f36782
Add performance testee.
salsolatragus Feb 24, 2021
7f5505f
Configure Commons to build a nuget package.
salsolatragus Mar 2, 2021
f0eca90
Remove unused import.
salsolatragus Mar 2, 2021
8657ed2
Add logging to commander.
salsolatragus Mar 2, 2021
577373d
Merge remote-tracking branch 'origin/tia_report' into tia
salsolatragus Mar 2, 2021
601669b
Performance improvements:
mpdeimos Mar 2, 2021
cfb259b
Merge branch 'tia' of https://github.com/cqse/teamscale-profiler-dotn…
mpdeimos Mar 2, 2021
d52ecaf
Add missing dependency to commander.
salsolatragus Mar 8, 2021
4cc5eb5
support test path prefixes
mpdeimos Feb 12, 2021
5907e52
correct emptiness handling for testwise traces
mpdeimos Feb 12, 2021
d0c4f3e
Add some interface comments.
salsolatragus Mar 10, 2021
e561a15
Reduce default log level to Info.
salsolatragus Mar 10, 2021
609bdfd
Add improvements to branch
Raphael-N Sep 8, 2021
8c869e9
Add comments and fix Testee bitness
Raphael-N Oct 4, 2021
975801d
fix empty traces
mpdeimos Mar 16, 2021
4cafeeb
* keep existing tests also for report merge
mpdeimos Mar 16, 2021
f7503c2
remove support for known test cases
mpdeimos Mar 17, 2022
793f93b
add support for partial coverage reports
mpdeimos Mar 17, 2022
e6c7c79
Potential Fix for crashes at Healthineers
Raphael-N Mar 22, 2022
244bc12
Fix casing
mpdeimos Mar 24, 2022
c780e5f
Commander CLI
mpdeimos Mar 24, 2022
ef2410a
Commander Server
mpdeimos Mar 24, 2022
717a669
Review
mpdeimos Apr 1, 2022
6717a8e
review
mpdeimos Apr 12, 2022
b083f25
add logging
mpdeimos Apr 13, 2022
7cece30
add quiet mode
mpdeimos Apr 13, 2022
889d158
additional null checks
mpdeimos Apr 13, 2022
3d3a934
add nullable library
mpdeimos Apr 13, 2022
823bac7
forbid setting test name to null
mpdeimos Apr 13, 2022
f1a85b3
🤦
mpdeimos Apr 13, 2022
4e08202
better error handling
mpdeimos Apr 13, 2022
725cbe5
Merge pull request #160 from cqse/tia_server_cli
Raphael-N Apr 25, 2022
af822fe
Update Platform version and toolset
Raphael-N Apr 26, 2022
59171c6
Remove ifdefs, rework, add tga toggle to options
Raphael-N Apr 26, 2022
e1ca972
Swap vectors instead of using a toggle boolean
Raphael-N Apr 28, 2022
9afa9aa
Rename method id vectors to primary and backing vectors
Raphael-N Apr 28, 2022
c57da74
Merge pull request #155 from cqse/tia-merge-reports
Raphael-N Apr 28, 2022
6bde083
Add tests for tga and tia configurations
Raphael-N May 12, 2022
776e0bd
Implement int set to achieve faster checks
Raphael-N May 22, 2022
ef52fae
Add documentation to custom set implementation
Raphael-N Jun 1, 2022
c5e0762
Merge branch 'tia' into performance_improvements_tia
Raphael-N Jun 1, 2022
b3d64f2
Fix minor issue
Raphael-N Jun 1, 2022
122a357
Rework
Raphael-N Jun 7, 2022
0bd6864
Merge pull request #158 from cqse/performance_improvements_tia
mpdeimos Jun 8, 2022
3e0225e
Fix issue in functionId_set
Raphael-N Jul 4, 2022
b09bc74
update bummer/update output path
mpdeimos Jul 8, 2022
04d1980
bummer update
mpdeimos Jul 14, 2022
6aeea2c
fix tests
mpdeimos Jul 14, 2022
ec9d95f
Use newer libzmq commands for context shutdown and add timeout to sub…
Raphael-N Aug 1, 2022
68bd98f
pre-initialize profiler ipc
mpdeimos Aug 10, 2022
37db7ce
Add documentation for TIA mode catch in shutdown
Raphael-N Jan 18, 2023
907d385
Merge branch 'master' into tia
Raphael-N Feb 8, 2023
1833413
Fix Test cases
Raphael-N Feb 8, 2023
6f5659f
Consider testwise coverage for artifactory uploads
Raphael-N May 19, 2023
0866873
Change name for artifactory report upload
Raphael-N Jun 16, 2023
ef114a8
Merge branch 'master' into tia
Raphael-N Jun 21, 2023
732af2b
Fix Test after merge
Raphael-N Jun 23, 2023
df39b8d
Remove Worker thread due to issues with many processes
Raphael-N Jul 24, 2023
34570e4
Add Zipping step to Artifactory Upload
Raphael-N Jul 30, 2023
eb09de3
Fix Artifactory Upload
Raphael-N Jul 30, 2023
7e6b4ee
Improve artifactory branches
Raphael-N Jul 30, 2023
13a4cc6
add dialog for recording test duration
Aug 1, 2023
265f77d
implement long <-> string conversion for duration
Aug 1, 2023
488b600
send adjusted duration to profiler
Aug 1, 2023
0013465
fix bugs
Aug 1, 2023
77f704a
fix teamscale findings
Aug 1, 2023
a14794b
Start implementing synchronous communication
Raphael-N Aug 2, 2023
25cc661
Add Socket handling
Raphael-N Aug 2, 2023
352cd4f
Support time configuration in profiler and daemon
Raphael-N Aug 2, 2023
82e4720
Use milliseconds for automated tests
Raphael-N Aug 2, 2023
1af9253
Fix some communication issues
Raphael-N Aug 3, 2023
48ec74d
rework
Aug 3, 2023
69c2fdf
update to newer framework version
Aug 4, 2023
50c49b8
malformed trace lines should not crash upload daemon
Aug 4, 2023
89f82ef
Send PID to ZmqIpcServer as clientID
Aug 4, 2023
b12a785
Update TargetFrameworkVersion in UploadDaemon_Test
Aug 4, 2023
96e5746
rework
Raphael-N Aug 7, 2023
82a9680
Rework
Raphael-N Aug 7, 2023
474fa63
Write as one string instead of per entry
Raphael-N Aug 7, 2023
78b8d62
Add synchronization to jit inlining events
Raphael-N Aug 9, 2023
1a961c8
Fix casing of results
Raphael-N Aug 17, 2023
8e94aa4
Merge branch 'tia_synchronous_events' of https://github.com/cqse/team…
Raphael-N Aug 17, 2023
269a07e
Disable inlining for accurate results
Raphael-N Aug 17, 2023
c584514
Merge pull request #180 from cqse/test-commander-change-duration
Raphael-N Aug 18, 2023
fa7ea27
Fix encoding of test names
Raphael-N Aug 29, 2023
c6fe173
Update Test Times and Add Checks for running Tests
Raphael-N Sep 19, 2023
a16e337
Fix initial test not appearing
Raphael-N Sep 22, 2023
652929c
Fix Process not shutting down
Raphael-N Sep 22, 2023
306ab2e
Improve performance of Upload Daemon
Raphael-N Sep 22, 2023
82c75f9
TS#35530 Check if the trace directory is writable
Raphael-N Sep 25, 2023
77630df
Fix issue with time sending
Raphael-N Oct 4, 2023
0485275
Reduce Memory Usage
Raphael-N Oct 27, 2023
6ef1bcf
Replace newline with space in testname
Raphael-N Oct 27, 2023
668537d
Implement Splitting for too large reports
Raphael-N Oct 30, 2023
7db2f6d
Merge branch 'tia' into tia_synchronous_events
Raphael-N Nov 27, 2023
5d1bb79
Cleanup leftovers from merge
Raphael-N Nov 29, 2023
5aa9762
Minor fixes
Raphael-N Jan 10, 2024
db12283
Fix several Teamscale findings
Raphael-N Jan 26, 2024
ca0da28
Add String report splitting for other upload types
Raphael-N Jan 31, 2024
9311980
Small fixes
Raphael-N Feb 27, 2024
a239651
Fix tests and socket configurations
Raphael-N Feb 28, 2024
20fa0fe
Fix Tests
Raphael-N Mar 20, 2024
62a1aeb
Update tests
Raphael-N Apr 10, 2024
a192408
More Test fixes and add back pipeline
Raphael-N Apr 12, 2024
b0ef272
Merge pull request #183 from cqse/tia_synchronous_events
Raphael-N Apr 12, 2024
38c11b4
Merge branch 'master' into tia
Raphael-N Jun 21, 2024
5160d84
Merge branch 'tia' of https://github.com/cqse/teamscale-profiler-dotn…
Raphael-N Jun 21, 2024
6800edd
Fix merge leftovers
Raphael-N Jun 26, 2024
0a63d9c
TS#38029 Fix remaining tests
Raphael-N Jul 10, 2024
a43ce20
Merge branch 'master' into tia
Raphael-N Jul 10, 2024
e71d373
TS#38029 Update Profiler Testee
Raphael-N Jul 10, 2024
91c8a68
TS#38029 Introduce AssemblyExtractor to fix EmbeddudUploadTarget Hand…
Raphael-N Jul 15, 2024
bd3289a
TS#38029 Fix TS findings
Raphael-N Jul 15, 2024
d660612
TS#38029 Rework functionId_set
Raphael-N Jul 22, 2024
a4a70c8
TS#38029 Refactor trace file parsing
Raphael-N Aug 1, 2024
55b4ec4
TS#38029 Fix leftover issues from TraceFileParser rework
Raphael-N Aug 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
zmq powered gui
mpdeimos committed Sep 28, 2020
commit 065c418ea6b468a878169697eba9c14e0f233b65
18 changes: 16 additions & 2 deletions Cqse.Teamscale.Profiler.Dotnet.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2027
# Visual Studio Version 16
VisualStudioVersion = 16.0.30517.126
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Profiler", "Profiler\Profiler.vcxproj", "{CC51C2F0-D0F2-41D9-B1D2-5108C1D3B8E6}"
EndProject
@@ -21,6 +21,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Profiler_Cpp_Test", "Profil
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DumpPdb", "DumpPdb\DumpPdb.csproj", "{BF294B13-B2BB-43B4-9F83-3AA0BE0DC448}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProfilerGui", "ProfilerGui\ProfilerGui.csproj", "{62C8C177-9CEA-41C1-8F11-180BE25DDCB4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -101,6 +103,18 @@ Global
{BF294B13-B2BB-43B4-9F83-3AA0BE0DC448}.Release|Win32.Build.0 = Release|Any CPU
{BF294B13-B2BB-43B4-9F83-3AA0BE0DC448}.Release|x64.ActiveCfg = Release|Any CPU
{BF294B13-B2BB-43B4-9F83-3AA0BE0DC448}.Release|x64.Build.0 = Release|Any CPU
{62C8C177-9CEA-41C1-8F11-180BE25DDCB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{62C8C177-9CEA-41C1-8F11-180BE25DDCB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{62C8C177-9CEA-41C1-8F11-180BE25DDCB4}.Debug|Win32.ActiveCfg = Debug|Any CPU
{62C8C177-9CEA-41C1-8F11-180BE25DDCB4}.Debug|Win32.Build.0 = Debug|Any CPU
{62C8C177-9CEA-41C1-8F11-180BE25DDCB4}.Debug|x64.ActiveCfg = Debug|Any CPU
{62C8C177-9CEA-41C1-8F11-180BE25DDCB4}.Debug|x64.Build.0 = Debug|Any CPU
{62C8C177-9CEA-41C1-8F11-180BE25DDCB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{62C8C177-9CEA-41C1-8F11-180BE25DDCB4}.Release|Any CPU.Build.0 = Release|Any CPU
{62C8C177-9CEA-41C1-8F11-180BE25DDCB4}.Release|Win32.ActiveCfg = Release|Any CPU
{62C8C177-9CEA-41C1-8F11-180BE25DDCB4}.Release|Win32.Build.0 = Release|Any CPU
{62C8C177-9CEA-41C1-8F11-180BE25DDCB4}.Release|x64.ActiveCfg = Release|Any CPU
{62C8C177-9CEA-41C1-8F11-180BE25DDCB4}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
6 changes: 6 additions & 0 deletions ProfilerGui/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
9 changes: 9 additions & 0 deletions ProfilerGui/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="ProfilerGui.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ProfilerGui"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
56 changes: 56 additions & 0 deletions ProfilerGui/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using ZeroMQ;

namespace ProfilerGui
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
private const string Endpoint = "tcp://127.0.0.1:5555";
private ZContext context;
private ZSocket socket;

protected override void OnStartup(StartupEventArgs e)
{
context = new ZContext();
socket = new ZSocket(context, ZSocketType.PUB);
socket.Bind(Endpoint);
}

protected override void OnExit(ExitEventArgs e)
{
socket.Dispose();
context.Dispose();
}

internal void StopProfiling()
{
using (var frame = new ZFrame("profilerStop"))
{
socket.Send(frame);
}
}

internal void StartProfiling(string testName = null)
{
string message = "profilerStart";
if (!string.IsNullOrWhiteSpace(testName))
{
message += " " + testName;
}

using (var frame = new ZFrame(message))
{
socket.Send(frame);
}
}
}
}
23 changes: 23 additions & 0 deletions ProfilerGui/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Window x:Class="ProfilerGui.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ProfilerGui"
mc:Ignorable="d"
Title="Teamscale .NET Profiler" Height="143.212" Width="419.635" ResizeMode="NoResize">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="116*"/>
<ColumnDefinition Width="91*"/>
</Grid.ColumnDefinitions>
<CheckBox Content="Enable Profiling" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="363" Height="15" IsChecked="{Binding Path=EnableProfiling}" Grid.ColumnSpan="2"/>
<Grid HorizontalAlignment="Left" Height="40" Margin="0,25,0,0" VerticalAlignment="Top" Width="400" IsEnabled="{Binding Path=EnableProfiling}" Grid.ColumnSpan="2">
<CheckBox Content="Testwise Profiling" HorizontalAlignment="Left" Margin="10,15,0,0" VerticalAlignment="Top" Height="15" Width="130" IsChecked="{Binding Path=TestWiseProfiling}"/>
<TextBox HorizontalAlignment="Left" Height="23" Margin="245,10,0,0" TextWrapping="Wrap" Text="{Binding Path=TestName, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Top" Width="145" IsEnabled="{Binding Path=TestWiseProfiling}"/>
<Label Content="Test Name" HorizontalAlignment="Left" Margin="171,9,0,0" VerticalAlignment="Top" Width="69" IsEnabled="False" Height="26"/>
</Grid>
<Button Content="Update" HorizontalAlignment="Left" Margin="10,73,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click" Height="20" IsEnabled="{Binding Path=NeedsUpdate}"/>
<Label HorizontalAlignment="Left" Margin="90,70,0,0" VerticalAlignment="Top" Width="283" IsEnabled="False" Height="26" Content="{Binding Path=StatusText}" Grid.ColumnSpan="2"/>
</Grid>
</Window>
62 changes: 62 additions & 0 deletions ProfilerGui/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ProfilerGui
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private MainWindowVM viewModel = new MainWindowVM();
private App app;

public MainWindow()
{
app = Application.Current as App;
this.DataContext = viewModel;
viewModel.StatusText = "Collecting coverage";
InitializeComponent();
}

private void Button_Click(object sender, RoutedEventArgs e)
{
if (!viewModel.EnableProfiling)
{
app.StopProfiling();
viewModel.StatusText = "Stopped collecting coverage";
}
else if (!viewModel.TestWiseProfiling)
{
app.StartProfiling();
viewModel.StatusText = "Collecting coverage";
}
else
{
if (string.IsNullOrWhiteSpace(viewModel.TestName))
{
viewModel.StatusText = "Please specify a test name";
}
else
{
app.StartProfiling(viewModel.TestName);
viewModel.StatusText = "Collecting coverage for test " + viewModel.TestName;
}
}

viewModel.NeedsUpdate = false;
}
}
}
70 changes: 70 additions & 0 deletions ProfilerGui/MainWindowVM.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace ProfilerGui
{
class MainWindowVM : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;

private bool enableProfiling = true;
public bool EnableProfiling
{
get => enableProfiling;
set => SetField(ref enableProfiling, value);
}

private bool testWiseProfiling = false;
public bool TestWiseProfiling
{
get => testWiseProfiling;
set => SetField(ref testWiseProfiling, value);
}

private string testName = null;
public string TestName
{
get => testName;
set => SetField(ref testName, value);
}

private bool needsUpdate = false;
public bool NeedsUpdate
{
get => needsUpdate;
set => SetField(ref needsUpdate, value);
}


private string statusText = null;
public string StatusText
{
get => statusText;
set => SetField(ref statusText, value);
}

private void SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
{
if (EqualityComparer<T>.Default.Equals(field, value))
{
return;
}

field = value;
OnPropertyChanged(propertyName);

if (propertyName != nameof(NeedsUpdate) && propertyName != nameof(StatusText))
{
NeedsUpdate = true;
}
}

private void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
112 changes: 112 additions & 0 deletions ProfilerGui/ProfilerGui.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{62C8C177-9CEA-41C1-8F11-180BE25DDCB4}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>ProfilerGui</RootNamespace>
<AssemblyName>ProfilerGui</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="ZeroMQ, Version=4.1.0.31, Culture=neutral, PublicKeyToken=4a9630883fd6c563, processorArchitecture=MSIL">
<HintPath>..\packages\ZeroMQ.4.1.0.31\lib\net40\ZeroMQ.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="MainWindowVM.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\ZeroMQ.4.1.0.31\build\net40\ZeroMQ.targets" Condition="Exists('..\packages\ZeroMQ.4.1.0.31\build\net40\ZeroMQ.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\ZeroMQ.4.1.0.31\build\net40\ZeroMQ.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ZeroMQ.4.1.0.31\build\net40\ZeroMQ.targets'))" />
</Target>
</Project>
55 changes: 55 additions & 0 deletions ProfilerGui/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ProfilerGui")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ProfilerGui")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.

//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]


[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]


// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
71 changes: 71 additions & 0 deletions ProfilerGui/Properties/Resources.Designer.cs
117 changes: 117 additions & 0 deletions ProfilerGui/Properties/Resources.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
30 changes: 30 additions & 0 deletions ProfilerGui/Properties/Settings.Designer.cs
7 changes: 7 additions & 0 deletions ProfilerGui/Properties/Settings.settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
4 changes: 4 additions & 0 deletions ProfilerGui/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ZeroMQ" version="4.1.0.31" targetFramework="net461" />
</packages>