The Metrics.NET library provides a way of instrumenting applications with custom metrics (timers, histograms, counters etc) that can be reported in various ways and can provide insights on what is happening inside a running application.
Current version of UniformReservoir stores values in array of UserValueWrapper. UserValueWrapper is a value type that consists of two fields. One of them is of type long and the other one is of type string. UserValueWrapper is larger that any native word. UniformReservoir Update()stores new values without locking or interlocked operations. GetSnapshot doesn't use locking or interlocked operation to copy array of values either. As I see it, UserValueWrapper instances writes and reads aren't atomic and because of that torn values may end up in reservoir or snapshot (see I.12.6.6 Atomic reads and writes section of ECMA-335 Common Language Infrastructure (CLI)). However, I wasn't able to write a test case that produces torn values.
Current version of UniformReservoir stores values in array of
UserValueWrapper
.UserValueWrapper
is a value type that consists of two fields. One of them is of typelong
and the other one is of typestring
.UserValueWrapper
is larger that any native word. UniformReservoirUpdate()
stores new values without locking or interlocked operations.GetSnapshot
doesn't use locking or interlocked operation to copy array of values either. As I see it,UserValueWrapper
instances writes and reads aren't atomic and because of that torn values may end up in reservoir or snapshot (see I.12.6.6 Atomic reads and writes section of ECMA-335 Common Language Infrastructure (CLI)). However, I wasn't able to write a test case that produces torn values.