Skip to content

Commit

Permalink
feat(profiler): configurable profile window length
Browse files Browse the repository at this point in the history
  • Loading branch information
gergelyke committed May 9, 2017
1 parent fc78970 commit 02a4e1d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/agent/profiler/cpu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function CpuProfiler (options) {
var self = this
this.collectorApi = options.collectorApi
this.controlBus = options.controlBus
this.profileWindow = 10000
this.profileWindow = options.config.profilerWindowLength

this.controlBus.on('cpu-profile', function (command) {
self.sendProfile(command)
Expand Down
3 changes: 2 additions & 1 deletion lib/agent/profiler/cpu/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ describe('The Cpu Profiler module', function () {

var profiler = CpuProfiler.create({
collectorApi: collectorApi,
controlBus: msgBus
controlBus: msgBus,
config: {}
})

profiler.profileWindow = 0
Expand Down
5 changes: 4 additions & 1 deletion lib/utils/configReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ ConfigReader.prototype._getEnvVarConfig = function () {
: undefined,
proxy: process.env.TRACE_PROXY || process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY,
keepQueryParams: process.env.TRACE_KEEP_QUERY_PARAMS,
collectSeverity: process.env.TRACE_COLLECT_SEVERITY
collectSeverity: process.env.TRACE_COLLECT_SEVERITY,
profilerWindowLength: process.env.TRACE_PROFILER_WINDOW_LENGTH
? parseInt(process.env.TRACE_PROFILER_WINDOW_LENGTH)
: 10000
}

if (process.env.TRACE_SAMPLER_LIMIT) {
Expand Down

0 comments on commit 02a4e1d

Please sign in to comment.