pyroscope icon indicating copy to clipboard operation
pyroscope copied to clipboard

Use default sample rate of 100 per second for CPU

Open simonswine opened this issue 1 year ago • 3 comments

This fixes the default sample rate for profiling and clarfies the field value. Relates to #3340.

simonswine avatar Jun 06 '24 13:06 simonswine

This seems to revert #2202 which I don't fully understand, do you have more context @korniltsev-grafanista ?

aleks-p avatar Oct 16 '25 15:10 aleks-p

I don't think its a revert - it was 100_000_000 then 1_000_000_000 with #2202 and now 100 with #3342

The fix in https://github.com/grafana/pyroscope/pull/2202 "fixed" the duration formatting for process_cpu:cpu:nanoseconds:cpu:nanoseconds sample type. Before the fix, the duration was 10 times bigger.

I look at the js code and this is how the formatter used to work back then

    const n = samples / sampleRate / this.divider;
    let nStr = n.toFixed(2);

which will accept for example 60_00_000_000 as the samples and sampleRate value is 1 second in nanoseconds and the divier is 60 - to get minutes, so the nStr is 1.00

I admit I don't fully understand the frontend code, not now, not back then when I "fixed" #2202

I also don't know how the current formatter works

korniltsev-grafanista avatar Oct 20 '25 09:10 korniltsev-grafanista

Screenshot_2025-10-20_16-06-19 Screenshot_2025-10-20_16-09-02

korniltsev-grafanista avatar Oct 20 '25 09:10 korniltsev-grafanista