-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from LeeCampbell/NetStandardSupport
Net standard support
- Loading branch information
Showing
169 changed files
with
978 additions
and
2,549 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
File renamed without changes
22 changes: 22 additions & 0 deletions
22
HdrHistogram.Benchmarking/HdrHistogram.Benchmarking.csproj
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,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFrameworks>net47;netcoreapp1.1</TargetFrameworks> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="BenchmarkDotNet" Version="0.10.6" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)' == 'net47'"> | ||
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows"> | ||
<Version>0.10.6</Version> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\HdrHistogram\HdrHistogram.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,30 @@ | ||
using BenchmarkDotNet.Running; | ||
using BenchmarkDotNet.Jobs; | ||
using BenchmarkDotNet.Diagnosers; | ||
using BenchmarkDotNet.Configs; | ||
using BenchmarkDotNet.Environments; | ||
|
||
namespace HdrHistogram.Benchmarking | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
var manualConfig = ManualConfig.Create(DefaultConfig.Instance); | ||
manualConfig.Add(new MemoryDiagnoser()); | ||
//manualConfig.Add(new BenchmarkDotNet.Diagnostics.Windows.InliningDiagnoser()); | ||
//manualConfig.Add(HardwareCounter.BranchMispredictions, HardwareCounter.BranchInstructions); | ||
var config = manualConfig | ||
.With(Job.Clr.With(Jit.LegacyJit)) | ||
.With(Job.Clr.With(Jit.RyuJit)) | ||
.With(Job.Core.With(Jit.RyuJit)); | ||
|
||
var switcher = new BenchmarkSwitcher(new[] { | ||
typeof(LeadingZeroCount.LeadingZeroCount64BitBenchmark), | ||
typeof(LeadingZeroCount.LeadingZeroCount32BitBenchmark), | ||
typeof(Recording.Recording32BitBenchmark), | ||
}); | ||
switcher.Run(args, config); | ||
} | ||
} | ||
} |
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,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp1.1</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\HdrHistogram\HdrHistogram.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
File renamed without changes.
File renamed without changes.
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
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,101 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp1.1</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="Resources\IsLastValueBug.hgrm" /> | ||
<None Remove="Resources\jHiccup-2.0.1.logV0.hlog" /> | ||
<None Remove="Resources\jHiccup-2.0.6.logV1.hlog" /> | ||
<None Remove="Resources\jHiccup-2.0.7S.logV2.hlog" /> | ||
<None Remove="Resources\Sample_10kBy1k_1sf_TicksPerHour_asMs_10percPerHalfDistance.csv" /> | ||
<None Remove="Resources\Sample_10kBy1k_1sf_TicksPerHour_asMs_10percPerHalfDistance.hgrm" /> | ||
<None Remove="Resources\Sample_10kBy1k_1sf_TicksPerHour_asMs_20percPerHalfDistance.csv" /> | ||
<None Remove="Resources\Sample_10kBy1k_1sf_TicksPerHour_asMs_20percPerHalfDistance.hgrm" /> | ||
<None Remove="Resources\Sample_10kBy1k_1sf_TicksPerHour_asMs_5percPerHalfDistance.csv" /> | ||
<None Remove="Resources\Sample_10kBy1k_1sf_TicksPerHour_asMs_5percPerHalfDistance.hgrm" /> | ||
<None Remove="Resources\Sample_10kBy1k_2sf_TicksPerHour_asMs_10percPerHalfDistance.csv" /> | ||
<None Remove="Resources\Sample_10kBy1k_2sf_TicksPerHour_asMs_10percPerHalfDistance.hgrm" /> | ||
<None Remove="Resources\Sample_10kBy1k_2sf_TicksPerHour_asMs_20percPerHalfDistance.csv" /> | ||
<None Remove="Resources\Sample_10kBy1k_2sf_TicksPerHour_asMs_20percPerHalfDistance.hgrm" /> | ||
<None Remove="Resources\Sample_10kBy1k_2sf_TicksPerHour_asMs_5percPerHalfDistance.csv" /> | ||
<None Remove="Resources\Sample_10kBy1k_2sf_TicksPerHour_asMs_5percPerHalfDistance.hgrm" /> | ||
<None Remove="Resources\Sample_10kBy1k_3sf_TicksPerHour_asMs_10percPerHalfDistance.csv" /> | ||
<None Remove="Resources\Sample_10kBy1k_3sf_TicksPerHour_asMs_10percPerHalfDistance.hgrm" /> | ||
<None Remove="Resources\Sample_10kBy1k_3sf_TicksPerHour_asMs_20percPerHalfDistance.csv" /> | ||
<None Remove="Resources\Sample_10kBy1k_3sf_TicksPerHour_asMs_20percPerHalfDistance.hgrm" /> | ||
<None Remove="Resources\Sample_10kBy1k_3sf_TicksPerHour_asMs_5percPerHalfDistance.csv" /> | ||
<None Remove="Resources\Sample_10kBy1k_3sf_TicksPerHour_asMs_5percPerHalfDistance.hgrm" /> | ||
<None Remove="Resources\Sample_10kBy1k_4sf_TicksPerHour_asMs_10percPerHalfDistance.csv" /> | ||
<None Remove="Resources\Sample_10kBy1k_4sf_TicksPerHour_asMs_10percPerHalfDistance.hgrm" /> | ||
<None Remove="Resources\Sample_10kBy1k_4sf_TicksPerHour_asMs_20percPerHalfDistance.csv" /> | ||
<None Remove="Resources\Sample_10kBy1k_4sf_TicksPerHour_asMs_20percPerHalfDistance.hgrm" /> | ||
<None Remove="Resources\Sample_10kBy1k_4sf_TicksPerHour_asMs_5percPerHalfDistance.csv" /> | ||
<None Remove="Resources\Sample_10kBy1k_4sf_TicksPerHour_asMs_5percPerHalfDistance.hgrm" /> | ||
<None Remove="Resources\Sample_10kBy1k_5sf_TicksPerHour_asMs_10percPerHalfDistance.csv" /> | ||
<None Remove="Resources\Sample_10kBy1k_5sf_TicksPerHour_asMs_10percPerHalfDistance.hgrm" /> | ||
<None Remove="Resources\Sample_10kBy1k_5sf_TicksPerHour_asMs_20percPerHalfDistance.csv" /> | ||
<None Remove="Resources\Sample_10kBy1k_5sf_TicksPerHour_asMs_20percPerHalfDistance.hgrm" /> | ||
<None Remove="Resources\Sample_10kBy1k_5sf_TicksPerHour_asMs_5percPerHalfDistance.csv" /> | ||
<None Remove="Resources\Sample_10kBy1k_5sf_TicksPerHour_asMs_5percPerHalfDistance.hgrm" /> | ||
<None Remove="Resources\tagged-Log.logV2.hlog" /> | ||
<None Remove="Resources\ycsb.logV1.hlog" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedResource Include="Resources\IsLastValueBug.hgrm" /> | ||
<EmbeddedResource Include="Resources\jHiccup-2.0.1.logV0.hlog" /> | ||
<EmbeddedResource Include="Resources\jHiccup-2.0.6.logV1.hlog" /> | ||
<EmbeddedResource Include="Resources\jHiccup-2.0.7S.logV2.hlog" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_1sf_TicksPerHour_asMs_10percPerHalfDistance.csv" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_1sf_TicksPerHour_asMs_10percPerHalfDistance.hgrm" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_1sf_TicksPerHour_asMs_20percPerHalfDistance.csv" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_1sf_TicksPerHour_asMs_20percPerHalfDistance.hgrm" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_1sf_TicksPerHour_asMs_5percPerHalfDistance.csv" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_1sf_TicksPerHour_asMs_5percPerHalfDistance.hgrm" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_2sf_TicksPerHour_asMs_10percPerHalfDistance.csv" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_2sf_TicksPerHour_asMs_10percPerHalfDistance.hgrm" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_2sf_TicksPerHour_asMs_20percPerHalfDistance.csv" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_2sf_TicksPerHour_asMs_20percPerHalfDistance.hgrm" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_2sf_TicksPerHour_asMs_5percPerHalfDistance.csv" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_2sf_TicksPerHour_asMs_5percPerHalfDistance.hgrm" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_3sf_TicksPerHour_asMs_10percPerHalfDistance.csv" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_3sf_TicksPerHour_asMs_10percPerHalfDistance.hgrm" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_3sf_TicksPerHour_asMs_20percPerHalfDistance.csv" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_3sf_TicksPerHour_asMs_20percPerHalfDistance.hgrm" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_3sf_TicksPerHour_asMs_5percPerHalfDistance.csv" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_3sf_TicksPerHour_asMs_5percPerHalfDistance.hgrm" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_4sf_TicksPerHour_asMs_10percPerHalfDistance.csv" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_4sf_TicksPerHour_asMs_10percPerHalfDistance.hgrm" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_4sf_TicksPerHour_asMs_20percPerHalfDistance.csv" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_4sf_TicksPerHour_asMs_20percPerHalfDistance.hgrm" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_4sf_TicksPerHour_asMs_5percPerHalfDistance.csv" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_4sf_TicksPerHour_asMs_5percPerHalfDistance.hgrm" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_5sf_TicksPerHour_asMs_10percPerHalfDistance.csv" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_5sf_TicksPerHour_asMs_10percPerHalfDistance.hgrm" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_5sf_TicksPerHour_asMs_20percPerHalfDistance.csv" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_5sf_TicksPerHour_asMs_20percPerHalfDistance.hgrm" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_5sf_TicksPerHour_asMs_5percPerHalfDistance.csv" /> | ||
<EmbeddedResource Include="Resources\Sample_10kBy1k_5sf_TicksPerHour_asMs_5percPerHalfDistance.hgrm" /> | ||
<EmbeddedResource Include="Resources\tagged-Log.logV2.hlog" /> | ||
<EmbeddedResource Include="Resources\ycsb.logV1.hlog" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="FluentAssertions" Version="4.19.2" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" /> | ||
<PackageReference Include="xunit" Version="2.2.0" /> | ||
<PackageReference Include="Xunit.Combinatorial" Version="1.2.1" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\HdrHistogram\HdrHistogram.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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,55 @@ | ||
using System; | ||
using System.Linq; | ||
using FluentAssertions; | ||
using HdrHistogram.Iteration; | ||
using Xunit; | ||
|
||
namespace HdrHistogram.UnitTests | ||
{ | ||
public static class HistogramAssert | ||
{ | ||
public static void AreEqual(HistogramBase expected, HistogramBase actual) | ||
{ | ||
Assert.Equal(expected.GetType(), actual.GetType()); | ||
AreValueEqual(expected, actual); | ||
} | ||
|
||
public static void AreValueEqual(HistogramBase expected, HistogramBase actual) | ||
{ | ||
expected.TotalCount.Should().Be(actual.TotalCount, "TotalCount property is not equal."); | ||
expected.Tag.Should().Be(actual.Tag, "Tag property is not equal."); | ||
expected.StartTimeStamp.Should().Be(actual.StartTimeStamp, "StartTimeStamp property is not equal."); | ||
expected.EndTimeStamp.Should().Be(actual.EndTimeStamp, "EndTimeStamp property is not equal."); | ||
expected.LowestTrackableValue.Should().Be(actual.LowestTrackableValue, "LowestTrackableValue property is not equal."); | ||
expected.HighestTrackableValue.Should().Be(actual.HighestTrackableValue, "HighestTrackableValue property is not equal."); | ||
expected.NumberOfSignificantValueDigits.Should().Be(actual.NumberOfSignificantValueDigits, "NumberOfSignificantValueDigits property is not equal."); | ||
|
||
var expectedValues = expected.AllValues().ToArray(); | ||
var actualValues = actual.AllValues().ToArray(); | ||
CollectionEquals(expectedValues, actualValues); | ||
} | ||
|
||
private static void CollectionEquals(HistogramIterationValue[] expected, HistogramIterationValue[] actual) | ||
{ | ||
if (expected == null && actual == null) | ||
return; | ||
if(expected == null) | ||
throw new Exception("Expected null array"); | ||
if (actual == null) | ||
throw new Exception("Unexpected null array"); | ||
|
||
if(expected.Length != actual.Length) | ||
throw new Exception($"Expected length of {expected.Length}, but recieved {actual.Length}"); | ||
|
||
for (int i = 0; i < expected.Length; i++) | ||
{ | ||
var e = expected[i]; | ||
var a = actual[i]; | ||
if (HistogramIterationValueComparer.Instance.Compare(e, a) != 0) | ||
{ | ||
throw new Exception($"Values differ at index {i}. Expected {e}, but recieved {a}"); | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.