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

built-in accurate and cross platform Memory Diagnoser #284

Merged
merged 14 commits into from
Nov 25, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
update to .NET Core 1.1, fixes #301
  • Loading branch information
adamsitnik committed Nov 18, 2016
commit 2a529abfff9d72bdd4b11d82d1c918beaffaf0ff
6 changes: 3 additions & 3 deletions docs/guide/Contributing/Building.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

For building the BenchmarkDotNet source-code, the following elements are required:

* [Visual Studio 2015 Update **3**](http://go.microsoft.com/fwlink/?LinkId=691129)
* [Visual Studio 2015 Update **3**](https://go.microsoft.com/fwlink/?LinkId=691978)
* [Latest NuGet Manager extension for Visual Studio](https://dist.nuget.org/visualstudio-2015-vsix/v3.5.0-beta/NuGet.Tools.vsix)
* [.NET Core SDK](https://go.microsoft.com/fwlink/?LinkID=809122)
* [.NET Core Tooling Preview 2 for Visual Studio 2015](https://go.microsoft.com/fwlink/?LinkId=817245)
* [.NET Core SDK **1.1**](https://go.microsoft.com/fwlink/?LinkID=835014)
* [.NET Core 1.0.1 Tooling Preview 2 for Visual Studio 2015](https://go.microsoft.com/fwlink/?LinkID=827546)
* Internet connection and disk space to download all the required packages

If your build fails because some packages are not available, let say F#, then just disable these project and hope for nuget server to work later on ;)
2 changes: 1 addition & 1 deletion samples/BenchmarkDotNet.Samples.FSharp.Core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"Microsoft.FSharp.Core.netcore": "1.0.0-*",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0-preview1-001100-00"
"version": "1.1.0"
},
"BenchmarkDotNet": {
"target": "project"
Expand Down
2 changes: 1 addition & 1 deletion samples/BenchmarkDotNet.Samples/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0-preview1-001100-00"
"version": "1.1.0"
},
"System.ComponentModel.EventBasedAsync": "4.0.11"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

namespace BenchmarkDotNet.Loggers
{
internal class AsynchronousProcessOutputLogger : IDisposable
internal class AsyncErrorOutputLogger : IDisposable
{
private readonly Process process;
private readonly ILogger logger;

public AsynchronousProcessOutputLogger(ILogger logger, Process process)
public AsyncErrorOutputLogger(ILogger logger, Process process)
{
if (process.StartInfo.UseShellExecute)
{
Expand All @@ -18,10 +18,6 @@ public AsynchronousProcessOutputLogger(ILogger logger, Process process)
this.logger = logger;
this.process = process;

if (process.StartInfo.RedirectStandardOutput)
{
this.process.OutputDataReceived += ProcessOnOutputDataReceived;
}
if (process.StartInfo.RedirectStandardError)
{
this.process.ErrorDataReceived += ProcessOnErrorDataReceived;
Expand All @@ -30,15 +26,9 @@ public AsynchronousProcessOutputLogger(ILogger logger, Process process)

public void Dispose()
{
process.OutputDataReceived -= ProcessOnOutputDataReceived;
process.ErrorDataReceived -= ProcessOnErrorDataReceived;
}

private void ProcessOnOutputDataReceived(object sender, DataReceivedEventArgs dataReceivedEventArgs)
{
logger.WriteLine(LogKind.Default, dataReceivedEventArgs.Data);
}

private void ProcessOnErrorDataReceived(object sender, DataReceivedEventArgs dataReceivedEventArgs)
{
if (!string.IsNullOrEmpty(dataReceivedEventArgs.Data)) // happened often and added unnecessary blank line to output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal static bool ExecuteCommand(string commandWithArguments, string workingD
{
using (var process = new Process { StartInfo = BuildStartInfo(workingDirectory, commandWithArguments) })
{
using (new AsynchronousProcessOutputLogger(logger, process))
using (new AsyncErrorOutputLogger(logger, process))
{
process.Start();

Expand All @@ -60,7 +60,7 @@ private static ProcessStartInfo BuildStartInfo(string workingDirectory, string a
Arguments = arguments,
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardOutput = true, // we redirect it but never call process.BeginOutputReadLine() in order to ignore it
RedirectStandardOutput = true,
RedirectStandardError = true
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/BenchmarkDotNet.Core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0-preview1-001100-00"
"version": "1.1.0"
},
"System.Runtime.Serialization.Primitives": "4.1.1",
"Microsoft.DotNet.InternalAbstractions": "1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/BenchmarkDotNet.IntegrationTests/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0-preview1-001100-00"
"version": "1.1.0"
},
"System.ComponentModel.EventBasedAsync": "4.0.11"
}
Expand Down
2 changes: 1 addition & 1 deletion tests/BenchmarkDotNet.Tests/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0-preview1-001100-00"
"version": "1.1.0"
},
"System.ComponentModel.EventBasedAsync": "4.0.11"
}
Expand Down