Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
60bea38
commit a8b4e7b
Showing
11 changed files
with
284 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_METHOD_ATTRIBUTE_ON_SAME_LINE/@EntryValue">True</s:Boolean> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GC/@EntryIndexedValue">GC</s:String></wpf:ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.Threading; | ||
using BenchmarkDotNet.Attributes; | ||
using BenchmarkDotNet.Attributes.Exporters; | ||
using BenchmarkDotNet.Attributes.Jobs; | ||
|
||
namespace BenchmarkDotNet.Samples.Intro | ||
{ | ||
[DryJob] | ||
[JsonExporterAttribute.Brief] | ||
[JsonExporterAttribute.Full] | ||
[JsonExporterAttribute.BriefCompressed] | ||
[JsonExporterAttribute.FullCompressed] | ||
[JsonExporter("-custom", indentJson: true, excludeMeasurements: true)] | ||
public class IntroJsonExport | ||
{ | ||
[Benchmark] public void Sleep10() => Thread.Sleep(10); | ||
[Benchmark] public void Sleep20() => Thread.Sleep(20); | ||
} | ||
} |
11 changes: 0 additions & 11 deletions
11
src/BenchmarkDotNet.Core/Attributes/Exporters/BriefJsonExporterAttribute.cs
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/BenchmarkDotNet.Core/Attributes/Exporters/FormattedJsonExporterAttribute.cs
This file was deleted.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
src/BenchmarkDotNet.Core/Attributes/Exporters/JsonExporterAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System; | ||
using BenchmarkDotNet.Exporters; | ||
using BenchmarkDotNet.Exporters.Json; | ||
|
||
namespace BenchmarkDotNet.Attributes.Exporters | ||
{ | ||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Assembly, AllowMultiple = true)] | ||
public class JsonExporterAttribute : ExporterConfigBaseAttribute | ||
{ | ||
protected JsonExporterAttribute(IExporter exporter) : base(exporter) | ||
{ | ||
} | ||
|
||
public JsonExporterAttribute(string fileNameSuffix = "", bool indentJson = false, bool excludeMeasurements = false) | ||
: this(new JsonExporter(fileNameSuffix, indentJson, excludeMeasurements)) | ||
{ | ||
} | ||
|
||
public class BriefAttribute : JsonExporterAttribute | ||
{ | ||
public BriefAttribute() : base(JsonExporter.Brief) | ||
{ | ||
} | ||
} | ||
|
||
public class Full : JsonExporterAttribute | ||
{ | ||
public Full() : base(JsonExporter.Full) | ||
{ | ||
} | ||
} | ||
|
||
public class BriefCompressed : JsonExporterAttribute | ||
{ | ||
public BriefCompressed() : base(JsonExporter.BriefCompressed) | ||
{ | ||
} | ||
} | ||
|
||
public class FullCompressed : JsonExporterAttribute | ||
{ | ||
public FullCompressed() : base(JsonExporter.FullCompressed) | ||
{ | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
src/BenchmarkDotNet.Core/Exporters/Json/BriefJsonExporter.cs
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
src/BenchmarkDotNet.Core/Exporters/Json/FormattedJsonExporter.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,22 @@ | ||
namespace BenchmarkDotNet.Exporters.Json | ||
{ | ||
public class JsonExporter : JsonExporterBase, IExporter | ||
public class JsonExporter : JsonExporterBase | ||
{ | ||
public static readonly IExporter Default = new JsonExporter(); | ||
public static readonly IExporter Brief = new JsonExporter("-brief", indentJson: true, excludeMeasurements: true); | ||
public static readonly IExporter Full = new JsonExporter("-full", indentJson: true, excludeMeasurements: false); | ||
public static readonly IExporter BriefCompressed = new JsonExporter("-brief-compressed", indentJson: false, excludeMeasurements: false); | ||
public static readonly IExporter FullCompressed = new JsonExporter("-full-compressed", indentJson: false, excludeMeasurements: false); | ||
|
||
public JsonExporter() : base(indentJson: false, excludeMeasurements: false) | ||
public static readonly IExporter Default = FullCompressed; | ||
|
||
protected override string FileNameSuffix { get; } = string.Empty; | ||
|
||
public JsonExporter(string fileNameSuffix = "", bool indentJson = false, bool excludeMeasurements = false) : base(indentJson, excludeMeasurements) | ||
{ | ||
FileNameSuffix = fileNameSuffix; | ||
} | ||
|
||
public static IExporter Custom(string fileNameSuffix = "", bool indentJson = false, bool excludeMeasurements = false) => | ||
new JsonExporter(fileNameSuffix, indentJson, excludeMeasurements); | ||
} | ||
} | ||
} |