-
Notifications
You must be signed in to change notification settings - Fork 30
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
A fix for HistogramBase.AllValues() returning a repeat of the last HistogramIterationValue #64
base: master
Are you sure you want to change the base?
Changes from all commits
34dea62
0ab1485
6ec7562
b236c0c
558d412
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,8 +34,13 @@ internal abstract class AbstractHistogramEnumerator : IEnumerator<HistogramItera | |
protected int CurrentSubBucketIndex { get; private set; } | ||
protected long TotalCountToCurrentIndex { get; private set; } | ||
protected long CountAtThisValue { get; private set; } | ||
|
||
public HistogramIterationValue Current { get; private set; } | ||
|
||
private HistogramIterationValue _current; | ||
public HistogramIterationValue Current | ||
{ | ||
get => _current.Clone(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can see the confusion here, but this is a low allocation path. Now that you are cloning (instead of using the value inplace) you are now allocating. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually(!), having just run the benchmarks on |
||
private set => _current = value; | ||
} | ||
|
||
protected AbstractHistogramEnumerator(HistogramBase histogram) | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,5 +103,7 @@ public override string ToString() | |
", Percentile:" + Percentile + | ||
", PercentileLevelIteratedTo:" + PercentileLevelIteratedTo; | ||
} | ||
|
||
public HistogramIterationValue Clone() => (HistogramIterationValue) this.MemberwiseClone(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No XML comments on a public member/method |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -255,6 +255,12 @@ Next can you please ensure that your PR (Pull Request) has a comment in it descr | |
Ideally if it is fixing an issue or a bug, there would be a Unit Test proving the fix and a reference to the Issues in the PR comments. | ||
|
||
|
||
### How to run tests? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for adding documentation like this.
|
||
If you are having trouble running xunit tests out of the box, it is possible to run them using a version of the command line below. | ||
You'll just need to fill in the correct value of $(SolutionDir), which should be as defined in Visual Studio. | ||
PS> dotnet C:\Users\%USERNAME%\.nuget\packages\xunit.runner.console\2.3.1\tools\netcoreapp2.0\xunit.console.dll $(SolutionDir)\HdrHistogram.UnitTests\bin\Debug\netcoreapp1.1\HdrHistogram.UnitTests.dll | ||
|
||
|
||
HdrHistogram Details | ||
---------------------------------------------- | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not targeting 4.7.1, but still 4.7. I think this would be a breaking change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also breaks the build.cmd file as it does hard code reference the .\HdrHistogram.Benchmarking\bin\Release\net47 path :-(