public void UpdateNumMsgsReceived(IMessage <T> message) { if (message != null) { _numMsgsReceived.Increment(); _numBytesReceived.Add(message.Data.Length); } }
public void StripedLongAdder() { _stripedLongAdder.Increment(); _stripedLongAdder.Decrement(); _stripedLongAdder.GetAndReset(); _stripedLongAdder.NonVolatileGetValue(); _stripedLongAdder.Increment(); _stripedLongAdder.Decrement(); }
public void IncrementNumAcksReceived(long latencyNs) { _numAcksReceived.Increment(); lock (Latency) { //var current = Latency.Length + 1; Latency.Add(TimeSpan.FromTicks(latencyNs).TotalMilliseconds); } }
private static void ValueAdderIncrement() { var atomicLong = new AtomicLong(0L); BenchmarkRunner.Run("AtomicLong.Increment", () => atomicLong.Increment()); var threadLocalAdder = new ThreadLocalLongAdder(0L); BenchmarkRunner.Run("ThreadLocalLongAdder.Increment", () => threadLocalAdder.Increment()); var strippedLongAdder = new StripedLongAdder(0L); BenchmarkRunner.Run("StripedLongAdder.Increment", () => strippedLongAdder.Increment()); }
/// <inheritdoc /> public void Update(long value) { StripedLongAdder bucketCounter = null; foreach (var kvp in _buckets) { if (kvp.Key < value) { break; } bucketCounter = kvp.Value; } bucketCounter.Increment(); _sum.Add(value); _counter.Increment(); }
static void Main(string[] args) { AtomicLong[] data = new AtomicLong[0]; BenchmarkRunner.DefaultMaxThreads = 8; BenchmarkRunner.DefaultTotalSeconds = 5; var strippedLongAdder = new StripedLongAdder(0L); var threadLocalAdder = new ThreadLocalLongAdder(0L); //BenchmarkRunner.Run("ThreadLocalLongAdder.Increment", () => threadLocalAdder.Increment()); //var sz = ThreadLocalLongAdder.GetEstimatedFootprintInBytes(threadLocalAdder); BenchmarkRunner.Run("StripedLongAdder.Increment", () => strippedLongAdder.Increment()); //BenchmarkRunner.Run("ThreadLocalLongAdder.Increment", () => threadLocalAdder.Increment()); //BenchmarkRunner.Run("NoOp", () => { }); ValueAdderIncrement(); }
public void Increment() { _num.Increment(1); }
/// <inheritdoc /> public long StartRecording() { _activeSessionsCounter.Increment(); return(_clock.Nanoseconds); }
public void Can_be_incremented() { _num.Increment(); _num.GetValue().Should().Be(1L); }
internal void IncrementUsageTracker() { usageCounter.Increment(); }
protected override void incrementTotalCount() { totalCount.Increment(); }
/// <inheritdoc /> public void Increment() { _counter.Increment(); }
public void IncrementSendFailed() { _numSendFailed.Increment(); }
public void IncrementNumBatchReceiveFailed() { _numBatchReceiveFailed.Increment(); }
public void IncrementNumAcksFailed() { _numAcksFailed.Increment(); }