leecampbell / hdrhistogram.net Goto Github PK
View Code? Open in Web Editor NEWPort of the HdrHistorgram to .NET/C#
License: Other
Port of the HdrHistorgram to .NET/C#
License: Other
Consider replacing the hand rolled perf tests with a wrapper from https://www.nuget.org/packages/BenchmarkDotNet/
Currently I believe that the only way for a .NET program to render the captured histograms into a chart is via the web project http://hdrhistogram.github.io/HdrHistogram/plotFiles.html.
It would be nice if this was ported to a .NET process (using the Drawing or WPF libs) to generate this stuff on the fly.
Create extreme packages that are designed for extreme performance cases
e.g. HdrHistogramLongx64.nupkg, HdrHistogramIntx64.nupkg, HdrHistogramShortx86.nupkg
Test to see if they provide significant improvements in
These would be targets for either .NET platforms requiring extreme throughput (MMOG, Trading, etc), or that require very small footprint (UWA, RasberryPi, etc)
Create an automated build that
Consider using AppVeyor?
Could use https://readthedocs.org/ to host the generated docs.
Make it easy to measure with this as the default
TicksInAnHour
outputValueUnitScalingRatio
to go from ticks to milliseconds (should appease the Mort dev) eg. LongHistogram.OutputPercentileDistribution(Console.Out, outputValueUnitScalingRatio: TicksInAMillisecond);
void RecordLatencyInTicks(this HistogramBase histogram, Action action)
{
var start = Stopwatch.GetTimestamp();
action();
var elapsedTicks = Stopwatch.GetTimestamp() - start;
histogram.RecordValue(elapsedTicks);
}
Ideally we just want to get a Histogram
var histogram = Histogram.Create()
.AsLong() //WTF to I get from this? --Can I prove the tradeoffs? is short or int faster/Smaller? I hope not, then I can delete them.
.WithTickPrecision()
.AsThreadSafe()
.Create()
then call
histogram.RecordLatency(()=>{...});
then output the results
historgram.OutputPercentileDistribution(Console.Out, OutputUnit.Milliseconds)
This allows consumers to not have to know about how it was constructed or how it will be charted
Adoption of a library can be greatly improved with quality documentation.
Providing guidelines on how to create consistent documentation can reduce rework and improve the feeling of a quality repository.
example of a set of guidelines : http://dotnet.github.io/orleans/Documentation-Guidelines
This seems like it will become a popular thing and people are already asking for it
https://gitter.im/HdrHistogram/HdrHistogram?at=563f8127c712fe074e4e7101
Update documentation to explain that .NET/Windows only supports a minimum precision of 100 nano-seconds (a tick).
As part of the publishing of a release package, not only produce the Nuget package and publish that to Nuget.org, but also publish the symbols to SymbolServer.org
Create an IHistogram
interface that the implementation all implement.
Then consumers can more easily replace entire implementations for testing, or even to just turn off (rotate with a NullImplementation
).
We currently have at the heart of the hot path a manual method for find the leading zero count.
This is used to identify the correct bucket to assign a recorded value.
Frustratingly, this is supported as an intrinsic instruction on most modern CPU architectures.
The code is found in Bitwise.NumberOfLeadingZeros
, and has been isolated with the intent that it can be a single place to refactor/optimize if the opportunity arises.
Follow this .NET core issue for progress/resolution https://github.com/dotnet/corefx/issues/2209
Document it or bin it
As this isn't the official HdrHistogram.NET Repo*, we shouldn't be taking the HdrHistogram nuget package title.
It appears to have been taken anyway by the existing thing.
https://www.nuget.org/packages/HdrHistogram.NET/
Also worth removing the build time dependency that has made it into the nuspec file declaration
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<!--TODO: rename to HdrHistogram -->
<id>HdrHistogram</id>
<version>2.0.75-beta</version>
<title>HdrHistogram</title>
...
<tags>HdrHistogram Histogram Instrumentation</tags>
<!--TODO: remove this build time dependency -->
<dependencies>
<dependency id="AssemblyVersion.MSBuild" version="0.1.0" />
</dependencies>
</metadata>
</package>
*Official one is here - https://github.com/HdrHistogram/HdrHistogram.net
To enable the community to contrubute to the repository in a consitent and predictable manner, it would be good if there was a set of standards for the project to adopt.
These expectation should be documented in the wiki
Either document it or bin it
It appears to be recommended practice to do so
Might also be relevant to investigate Open Source Signing when the lib adopts .NET Core
I don't believe that the current nuget package can be used on PCL projects( e.g. ReactiveTrader). I believe that it has no dependency on platform specific features, so I think it would be safe to make it PCL compliant.
Guidance from Gil:
Auto-sizing is another useful thing… Not having to specify an initial range is useful for lazy folks (who are ok with resizing latencies in the recording path). It is also useful as a way to avoid overflowing wrongly-initial-sized histograms: unexpected large values result in a resize rather than an AIOOB exception. If your are ok with taking the latency hit (and potential mem size hit) for that, it's cleaner to code to.
I am not sure what the Skinny Histogram is and what it could offer the .NET project.
As asked and answered here [https://gitter.im/HdrHistogram/HdrHistogram?at=56db5610ddfe3d431627fa97]
Consider supporting Recorder (which supports multiple concurrent writers), but that will also require a ConcurrentHistogram.
Question: What is the Recorder?
I think he means Recorder.java and the specialist implementations such as SingleWriterRecorder.java and DoubleRecorder.java
You can see a good pattern for using a Recorder (along with a log writer) in jHiccup: https://github.com/giltene/jHiccup/blob/master/src/main/java/org/jhiccup/HiccupMeter.java#L626
SingleWriterRecorder is probably the most common use case, and the fastest in code. Recorder supports multiple writer threads, which is less commonly needed. DoubleRecorder will only be needed once you port DoubleHistogram.
Taken from HdrHistogram/HdrHistogram.NET#11
Currently only the LongHistogram
has a matching synchronized version. It seems reasonable to provide implementations for short
and int
as well.
This feature also seems to be an appropriate time to introduce a factory to help guide consumers as to which one is appropriate e.g.
var defaultHistogram = Histogram.Factory.Create(); //Creates a LongHistogram
var synchronizedLongHistogram = Histogram.Factory.AsThreadSafe().Create(); //Creates a SynchronizedLongHistogram
var longHistogram = Histogram.Factory.AsLongBacked().Create(); //Creates a LongHistogram
var synchronizedLongHistogram2 = Histogram.Factory.AsLongBacked().AsThreadSafe().Create(); //Creates a SynchronizedLongHistogram
var intHistogram = Histogram.Factory.AsIntBacked().Create(); //Creates a IntHistogram
var synchronizedIntHistogram = Histogram.Factory.AsIntBacked().AsThreadSafe().Create(); //Creates a SynchronizedIntHistogram
var shortHistogram = Histogram.Factory.AsShortBacked().Create(); //Creates a ShortHistogram
var synchronizedShortHistogram = Histogram.Factory.AsShortBacked().AsThreadSafe().Create(); //Creates a SynchronizedShortHistogram
See @giltene note from gitter
https://gitter.im/HdrHistogram/HdrHistogram?at=5721811439700a780927e117
Support a log writer that would output V2 encoded histograms to a log file compatible with HistogramLogWriter
I assume that there is a simple way to add a middleware/handler/router/filter/thing to ASP.NET to allow HdrHistogram to record the time taken for the request to be processed.
If there is then this would be good to provide as a separate nuget package that web devs can just add and then wire up in a one-liner
It should
Test logs with V2, V1, and V0 encoded histograms are included in the Java repo under test/resources.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.