class PoissonSampler
Defined at line 38 of file ../../src/performance/memory/sampler/instrumentation/poisson_sampler.h
Helper class to implement a Poisson point process.
The Poisson point process is a commonly used sampling strategy:
we consider the line of allocated bytes over time, and we select
bytes following a Poisson distribution. When a byte has been
selected, we record its entire allocation (and the corresponding
deallocation).
This strategy has desirable properties:
* It skews profiles towards large allocations, which are more
likely to be problematic or interesting.
* It introduces some amount of randomness, to prevent aliasing
issues (i.e. an allocation pattern that significantly distorts
the view presented by the profile).
* It is memoryless (in the sense that computing sampled bytes
does not rely on the history of previously sampled bytes).
* We can define a sampling rate in terms of average allocated
memory between samples.
* There is a rather straightforward way of generating
inter-arrival intervals via the inverse CDF method, making it
rather straightforward to implement.
Public Methods
void PoissonSampler (size_t mean_interval, std::unique_ptr<SampleIntervalGenerator> sample_interval_generator)
Provide custom sample interval generator.
Defined at line 48 of file ../../src/performance/memory/sampler/instrumentation/poisson_sampler.h
void PoissonSampler (size_t mean_interval)
Use provided default Poisson point process appropriate sample
interval generator.
Defined at line 54 of file ../../src/performance/memory/sampler/instrumentation/poisson_sampler.cc
bool ShouldSampleAllocation (size_t size)
Given the size of an allocation, and the current state of the
sampler, decide whether to capture a sample.
Note: calling this function progresses the Poisson point process,
which is effectful.
Defined at line 69 of file ../../src/performance/memory/sampler/instrumentation/poisson_sampler.cc