mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Renamed performanceMonitoring
config to telemetry
(#19613)
no issue
- Renaming the configuration parameter created in this commit:
e0dae46dfc
- No functional difference, this change just makes the configuration a
bit more succinct
This commit is contained in:
parent
e0dae46dfc
commit
975bb6849f
4 changed files with 11 additions and 11 deletions
|
@ -4,7 +4,7 @@ class ConnectionPoolInstrumentation {
|
|||
this.pool = this.knex.client.pool;
|
||||
this.logging = logging;
|
||||
this.metrics = metrics;
|
||||
this.enabled = config.get('performanceMonitoring:connectionPool');
|
||||
this.enabled = config.get('telemetry:connectionPool');
|
||||
this.requestStartTimes = {};
|
||||
this.createStartTimes = {};
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ function configure(dbConfig) {
|
|||
|
||||
if (!knexInstance && config.get('database') && config.get('database').client) {
|
||||
knexInstance = knex(configure(config.get('database')));
|
||||
if (config.get('performanceMonitoring:connectionPool')) {
|
||||
if (config.get('telemetry:connectionPool')) {
|
||||
const instrumentation = new ConnectionPoolInstrumentation({knex: knexInstance, logging, metrics, config});
|
||||
instrumentation.instrument();
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ Object.defineProperty(exports, 'knex', {
|
|||
configurable: true,
|
||||
get: function get() {
|
||||
connection = connection || require('./connection');
|
||||
if (config.get('performanceMonitoring:connectionPool')) {
|
||||
if (config.get('telemetry:connectionPool')) {
|
||||
const instrumentation = new ConnectionPoolInstrumentation({knex: connection, logging, metrics, config});
|
||||
instrumentation.instrument();
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ describe('ConnectionPoolInstrumentation', function () {
|
|||
const logging = {};
|
||||
const metrics = {};
|
||||
const config = {
|
||||
get: sinon.stub().returns(true)
|
||||
get: sinon.stub().withArgs('telemetry:connectionPool').returns(true)
|
||||
};
|
||||
const instrumentation = new ConnectionPoolInstrumentation({knex, logging, metrics, config});
|
||||
const result = instrumentation.getPoolMetrics();
|
||||
|
@ -52,7 +52,7 @@ describe('ConnectionPoolInstrumentation', function () {
|
|||
metric: sinon.stub()
|
||||
};
|
||||
const config = {
|
||||
get: sinon.stub().returns(true)
|
||||
get: sinon.stub().withArgs('telemetry:connectionPool').returns(true)
|
||||
};
|
||||
const instrumentation = new ConnectionPoolInstrumentation({knex, logging, metrics, config});
|
||||
instrumentation.handleCreateRequest(1);
|
||||
|
@ -80,7 +80,7 @@ describe('ConnectionPoolInstrumentation', function () {
|
|||
metric: sinon.stub()
|
||||
};
|
||||
const config = {
|
||||
get: sinon.stub().returns(true)
|
||||
get: sinon.stub().withArgs('telemetry:connectionPool').returns(true)
|
||||
};
|
||||
const instrumentation = new ConnectionPoolInstrumentation({knex, logging, metrics, config});
|
||||
instrumentation.handleCreateRequest(1);
|
||||
|
@ -107,7 +107,7 @@ describe('ConnectionPoolInstrumentation', function () {
|
|||
metric: sinon.stub()
|
||||
};
|
||||
const config = {
|
||||
get: sinon.stub().returns(true)
|
||||
get: sinon.stub().withArgs('telemetry:connectionPool').returns(true)
|
||||
};
|
||||
const instrumentation = new ConnectionPoolInstrumentation({knex, logging, metrics, config});
|
||||
instrumentation.handleAcquireRequest(1);
|
||||
|
@ -135,7 +135,7 @@ describe('ConnectionPoolInstrumentation', function () {
|
|||
metric: sinon.stub()
|
||||
};
|
||||
const config = {
|
||||
get: sinon.stub().returns(true)
|
||||
get: sinon.stub().withArgs('telemetry:connectionPool').returns(true)
|
||||
};
|
||||
const instrumentation = new ConnectionPoolInstrumentation({knex, logging, metrics, config});
|
||||
instrumentation.handleAcquireRequest(1);
|
||||
|
@ -162,7 +162,7 @@ describe('ConnectionPoolInstrumentation', function () {
|
|||
metric: sinon.stub()
|
||||
};
|
||||
const config = {
|
||||
get: sinon.stub().returns(true)
|
||||
get: sinon.stub().withArgs('telemetry:connectionPool').returns(true)
|
||||
};
|
||||
const instrumentation = new ConnectionPoolInstrumentation({knex, logging, metrics, config});
|
||||
instrumentation.handleRelease(1);
|
||||
|
@ -191,7 +191,7 @@ describe('ConnectionPoolInstrumentation', function () {
|
|||
metric: sinon.stub()
|
||||
};
|
||||
const config = {
|
||||
get: sinon.stub().returns(true)
|
||||
get: sinon.stub().withArgs('telemetry:connectionPool').returns(true)
|
||||
};
|
||||
const instrumentation = new ConnectionPoolInstrumentation({knex, logging, metrics, config});
|
||||
instrumentation.instrument();
|
||||
|
@ -219,7 +219,7 @@ describe('ConnectionPoolInstrumentation', function () {
|
|||
metric: sinon.stub()
|
||||
};
|
||||
const config = {
|
||||
get: sinon.stub().returns(false)
|
||||
get: sinon.stub().withArgs('telemetry:connectionPool').returns(false)
|
||||
};
|
||||
const instrumentation = new ConnectionPoolInstrumentation({knex, logging, metrics, config});
|
||||
instrumentation.instrument();
|
||||
|
|
Loading…
Add table
Reference in a new issue