Skip to content

Commit 4e1033e

Browse files
committed
Set default sampling interval in millis in config
1 parent 6ce6a8f commit 4e1033e

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

packages/dd-trace/src/profiling/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ class Config {
171171
samplingContextsAvailable))
172172
checkOptionWithSamplingContextAllowed(this.cpuProfilingEnabled, 'CPU profiling')
173173

174+
this.samplingInterval = coalesce(options.samplingInterval, 1e3 / 99) // 99hz in millis
175+
174176
this.heapSamplingInterval = coalesce(options.heapSamplingInterval,
175177
Number(DD_PROFILING_HEAP_SAMPLING_INTERVAL))
176178
const uploadCompression0 = coalesce(options.uploadCompression, DD_PROFILING_DEBUG_UPLOAD_COMPRESSION, 'on')

packages/dd-trace/src/profiling/profilers/wall.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function ensureChannelsActivated () {
7171
class NativeWallProfiler {
7272
constructor (options = {}) {
7373
this.type = 'wall'
74-
this._samplingIntervalMicros = options.samplingInterval || 1e6 / 99 // 99hz
74+
this._samplingIntervalMicros = (options.samplingInterval || 1e3 / 99) * 1000 // 99hz
7575
this._flushIntervalMillis = options.flushInterval || 60 * 1e3 // 60 seconds
7676
this._codeHotspotsEnabled = !!options.codeHotspotsEnabled
7777
this._endpointCollectionEnabled = !!options.endpointCollectionEnabled

packages/dd-trace/test/profiling/profilers/wall.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('profilers/native/wall', () => {
6666
})
6767

6868
it('should use the provided configuration options', () => {
69-
const samplingInterval = 500
69+
const samplingInterval = .5
7070
const profiler = new NativeWallProfiler({ samplingInterval })
7171

7272
profiler.start()

0 commit comments

Comments
 (0)