Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
sender.db.pool.text = function internal(props) {
// eslint-disable-next-line no-param-reassign
props.path = config.pathPrefix + props.path;
// eslint-disable-next-line prefer-rest-params
return oldText.apply(this, arguments);
};
sender.db.pool.discard = function internal(props) {
// eslint-disable-next-line no-param-reassign
props.path = config.pathPrefix + props.path;
// eslint-disable-next-line prefer-rest-params
return oldDiscard.apply(this, arguments);
};
this.reporter = new InfluxMetricReporter({
sender,
tags,
unit: MILLISECOND,
reportInterval: 30000,
});
this.reporter.setLog({
info: () => {},
trace: () => {},
debug: () => {},
warn: () => {},
error: () => {},
});
this.metrics = {};
this.registry = new MetricRegistry();
async function influxReporter (registry, tags) {
const {
DefaultSender,
InfluxMetricReporter
} = require('inspector-influx')
const sender = new DefaultSender({
database: 'express4',
hosts: [{
host: '127.0.0.1',
port: 8086
}]
})
const reporter = new InfluxMetricReporter({
log: null,
minReportingTimeout: 30,
reportInterval: 5000,
sender
})
reporter.setTags(tags)
reporter.addMetricRegistry(registry)
await reporter.start()
return reporter
}