Giter Site home page Giter Site logo

hdrhistogram.net's People

Contributors

chrisvest avatar ecoffey avatar giltene avatar gitter-badger avatar guillaume-alvarez avatar jerrinot avatar jpountz avatar leecampbell avatar maggu2810 avatar mattwarren avatar mikeb01 avatar mkosmul avatar nitsanw avatar peterfaiman avatar peterm0x avatar rkuhn avatar sbtourist avatar stig avatar trask avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

qooroo bucklr

hdrhistogram.net's Issues

Create extreme packages

Create extreme packages that are designed for extreme performance cases

  • only have a single implementation of a histogram defined
  • remove the base class
  • only implement the interface
  • sealed class with no inheritance
  • x64 and x86 (32bit) releases.
  • no support for synchronization.

e.g. HdrHistogramLongx64.nupkg, HdrHistogramIntx64.nupkg, HdrHistogramShortx86.nupkg

Test to see if they provide significant improvements in

  • footprint (dll/nuget package)
  • throughput

These would be targets for either .NET platforms requiring extreme throughput (MMOG, Trading, etc), or that require very small footprint (UWA, RasberryPi, etc)

Create CI build

Create an automated build that

  • compiles the code for each platform
  • Runs portability analyzer (is this needed if we do a build for each platform?)
  • runs all the tests
  • packages and deploys

Consider using AppVeyor?

Abstract recording precision from consumer

Make it easy to measure with this as the default

  • Create constants of TicksInAnHour
  • Set default value for outputValueUnitScalingRatio to go from ticks to milliseconds (should appease the Mort dev) eg. LongHistogram.OutputPercentileDistribution(Console.Out, outputValueUnitScalingRatio: TicksInAMillisecond);
  • Create the MeasureAcount ex method
void RecordLatencyInTicks(this HistogramBase histogram, Action action)
{
    var start = Stopwatch.GetTimestamp();
    action();
    var elapsedTicks = Stopwatch.GetTimestamp() - start;
    histogram.RecordValue(elapsedTicks);
}
  • Potentially rename our Histograms, or provide the factories that are appropriate.

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

Publish pdbs to SymbolServer.org

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

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).

Lzct SSE instruction when available

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

Mark the Nuget Package as "Unofficial"

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

Create coding standards

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.

  • Which style of C# to use (e.g. StyleCop defaults vs Resharper defaults)
  • Expectation of XML documentation for public api
  • Test coverage and style expectations.
  • Platform support that is expected (.NET 20-4.5, Mono, Dnxcore etc?)

These expectation should be documented in the wiki

Auto-sizing

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.

Investigate SkinnyHistogram

I am not sure what the Skinny Histogram is and what it could offer the .NET project.

  • [https://github.com/HdrHistogram/HdrHistogram/blob/master/HdrHistogram-benchmarks/src/main/java/org/HdrHistogram/SkinnyHistogram.java]
  • [https://github.com/Searchlight/khronus/blob/master/khronus-core/src/main/scala/com/searchlight/khronus/model/SkinnyHistogram.scala]
  • khronus/khronus#21 (comment)

Create a Recorder

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

Create synchronized version for each storage type

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

Create a Log writer

Support a log writer that would output V2 encoded histograms to a log file compatible with HistogramLogWriter

Instrument ASP.NET end point package

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

  • record the service time,
  • autorotate instances of HdrHistogram when writing to disk (to target directory)
  • default to using the endpoint/method/action name as the key for grouping. (hsitograms can be merged at later date for higher level aggregates)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.