From 4dab881231f1d046e9e84125bc5e3f98045f4377 Mon Sep 17 00:00:00 2001 From: Michael Goin Date: Tue, 8 Oct 2019 10:35:28 -0700 Subject: [PATCH] Removes usage of data_report_period. --- lib/agent.js | 6 +++--- lib/config/index.js | 4 ---- test/unit/agent/agent.test.js | 2 -- test/unit/config/config.test.js | 22 ---------------------- 4 files changed, 3 insertions(+), 31 deletions(-) diff --git a/lib/agent.js b/lib/agent.js index f2e3c294b3..d5b9f112a4 100644 --- a/lib/agent.js +++ b/lib/agent.js @@ -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' @@ -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 }, @@ -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) } }) @@ -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()) { diff --git a/lib/config/index.js b/lib/config/index.js index e3bbdfa16d..d5e78560b1 100644 --- a/lib/config/index.js +++ b/lib/config/index.js @@ -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 @@ -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': diff --git a/test/unit/agent/agent.test.js b/test/unit/agent/agent.test.js index 8378fe3878..2878a4c97d 100644 --- a/test/unit/agent/agent.test.js +++ b/test/unit/agent/agent.test.js @@ -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: [] } @@ -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([]) diff --git a/test/unit/config/config.test.js b/test/unit/config/config.test.js index ed6ef784d5..5a5ec4024d 100644 --- a/test/unit/config/config.test.js +++ b/test/unit/config/config.test.js @@ -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 = {