Skip to content

Commit

Permalink
Removes usage of data_report_period.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelgoin committed Oct 8, 2019
1 parent c1fe8a0 commit 4dab881
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 31 deletions.
6 changes: 3 additions & 3 deletions lib/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function Agent(config) {
this.tracer = new Tracer(this)
this.traces = new TransactionTraceAggregator(
{
periodMs: config.event_harvest_config.report_period_ms,
periodMs: DEFAULT_HARVEST_INTERVAL_MS,
config: this.config,
isAsync: !config.serverless_mode.enabled,
method: 'transaction_sample_data'
Expand All @@ -167,7 +167,7 @@ function Agent(config) {
this.queries = new QueryTraceAggregator(
{
config: this.config,
periodMs: config.event_harvest_config.report_period_ms,
periodMs: DEFAULT_HARVEST_INTERVAL_MS,
method: 'sql_trace_data',
isAsync: !config.serverless_mode.enabled
},
Expand Down Expand Up @@ -603,7 +603,6 @@ Agent.prototype.harvest = function harvest(callback) {
agent.emit('harvestFinished')
logger.info('Harvest finished.')

agent._scheduleHarvester(agent.config.data_report_period)
callback(error)
}
})
Expand Down Expand Up @@ -652,6 +651,7 @@ Agent.prototype.harvestSync = function harvestSync() {
logger.info('Harvest finished.')
}

// TODO: Replace me
Agent.prototype._generateHarvestMetrics = function _generateHarvestMetrics() {
// Note some information about the size of this harvest.
if (logger.traceEnabled()) {
Expand Down
4 changes: 0 additions & 4 deletions lib/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,6 @@ function Config(config) {
this.sampling_target_period_in_seconds = 60
this.max_payload_size_in_bytes = DEFAULT_MAX_PAYLOAD_SIZE_IN_BYTES

// how frequently harvester runs
this.data_report_period = 60

// this value is arbitrary
this.max_trace_segments = 900

Expand Down Expand Up @@ -338,7 +335,6 @@ Config.prototype._fromServer = function _fromServer(params, key) {

case 'apdex_t':
case 'web_transactions_apdex':
case 'data_report_period':
this._updateIfChanged(params, key)
break
case 'event_harvest_config':
Expand Down
2 changes: 0 additions & 2 deletions test/unit/agent/agent.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,6 @@ describe('the New Relic agent', function() {
var config = {
agent_run_id: 404,
apdex_t: 0.742,
data_report_period: 69,
url_rules: []
}

Expand Down Expand Up @@ -627,7 +626,6 @@ describe('the New Relic agent', function() {

expect(agent._state).equal('started')
expect(agent.config.run_id).equal(404)
expect(agent.config.data_report_period).equal(69)
expect(agent.metrics._apdexT).equal(0.742)
expect(agent.urlNormalizer.rules).deep.equal([])

Expand Down
22 changes: 0 additions & 22 deletions test/unit/config/config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1580,28 +1580,6 @@ describe('the agent configuration', function() {
expect(config.serverless_mode.enabled).to.be.false
})

describe('when data_report_period is set', function() {
it('should emit data_report_period when harvest interval is changed', (done) => {
config.once('data_report_period', function(harvestInterval) {
expect(harvestInterval).equal(45)

done()
})

config.onConnect({'data_report_period': 45})
})

it('should update data_report_period only when it is changed', function() {
expect(config.data_report_period).equal(60)

config.once('data_report_period', function() {
throw new Error('should never get here')
})

config.onConnect({'data_report_period': 60})
})
})

describe('when event_harvest_config is set', function() {
it('should emit event_harvest_config when harvest interval is changed', (done) => {
const expectedHarvestConfig = {
Expand Down

0 comments on commit 4dab881

Please sign in to comment.