Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
using CSharp.Atomic;
using HdrHistogram.NET.Iteration;
using HdrHistogram.NET.Utilities;
using LongBuffer = HdrHistogram.NET.Utilities.WrappedBuffer<long>;
namespace HdrHistogram.NET
public class HistogramAllInOneClass
internal static readonly AtomicLong constructionIdentityCount = new AtomicLong(0);
// "Cold" accessed fields. Not used in the recording code path:
internal long identity;
internal long highestTrackableValue;
internal long lowestTrackableValue;
internal int numberOfSignificantValueDigits;
internal int bucketCount;
internal int subBucketCount;
internal int countsArrayLength;
internal int wordSizeInBytes;
internal long startTimeStampMsec;
internal long endTimeStampMsec;
internal PercentileIterator percentileIterator;
internal RecordedValuesIterator recordedValuesIterator;
internal ByteBuffer intermediateUncompressedByteBuffer = null;
protected object updateLock = new object();
// "Hot" accessed fields (used in the the value recording code path) are bunched here, such
// that they will have a good chance of ending up in the same cache line as the totalCounts and
// counts array reference fields that subclass implementations will typically add.
internal int subBucketHalfCountMagnitude;
internal int unitMagnitude;
internal int subBucketHalfCount;
internal long subBucketMask;
// Sub-classes will typically add a totalCount field and a counts array field, which will likely be laid out
// right around here due to the subclass layout rules in most practical JVM implementations.
long totalCount;
readonly long[] counts;
private LongBuffer cachedDstLongBuffer = null;
private ByteBuffer cachedDstByteBuffer = null;
private int cachedDstByteBufferPosition = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment