remove profiler.
This commit is contained in:
parent
20e0d6632d
commit
40217ebebe
@ -67,7 +67,6 @@ function Chain(options) {
|
|||||||
|
|
||||||
this.network = bcoin.network.get(options.network);
|
this.network = bcoin.network.get(options.network);
|
||||||
this.logger = options.logger || bcoin.defaultLogger;
|
this.logger = options.logger || bcoin.defaultLogger;
|
||||||
this.profiler = options.profiler;
|
|
||||||
this.db = new bcoin.chaindb(this, options);
|
this.db = new bcoin.chaindb(this, options);
|
||||||
this.total = 0;
|
this.total = 0;
|
||||||
this.currentBlock = null;
|
this.currentBlock = null;
|
||||||
@ -221,9 +220,6 @@ Chain.prototype._open = function open(callback) {
|
|||||||
self.network.updateHeight(tip.height);
|
self.network.updateHeight(tip.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.profiler)
|
|
||||||
self.profiler.snapshot();
|
|
||||||
|
|
||||||
self.logger.memory();
|
self.logger.memory();
|
||||||
|
|
||||||
self.getInitialState(function(err) {
|
self.getInitialState(function(err) {
|
||||||
@ -236,9 +232,6 @@ Chain.prototype._open = function open(callback) {
|
|||||||
if (self.segwitActive)
|
if (self.segwitActive)
|
||||||
self.logger.info('Segwit is active.');
|
self.logger.info('Segwit is active.');
|
||||||
|
|
||||||
if (self.profiler)
|
|
||||||
self.profiler.snapshot();
|
|
||||||
|
|
||||||
self.logger.memory();
|
self.logger.memory();
|
||||||
|
|
||||||
self.emit('tip', tip);
|
self.emit('tip', tip);
|
||||||
@ -1542,11 +1535,9 @@ Chain.prototype.add = function add(block, callback, force) {
|
|||||||
// Keep track of total blocks handled.
|
// Keep track of total blocks handled.
|
||||||
self.total += total;
|
self.total += total;
|
||||||
|
|
||||||
// Take heap snapshot for debugging.
|
// Report memory for debugging.
|
||||||
if (self.total === 1 || self.total % 20 === 0) {
|
if (self.total === 1 || self.total % 20 === 0) {
|
||||||
utils.gc();
|
utils.gc();
|
||||||
if (self.profiler)
|
|
||||||
self.profiler.snapshot();
|
|
||||||
self.logger.memory();
|
self.logger.memory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,6 @@
|
|||||||
var bcoin = require('./env');
|
var bcoin = require('./env');
|
||||||
var AsyncObject = require('./async');
|
var AsyncObject = require('./async');
|
||||||
var utils = require('./utils');
|
var utils = require('./utils');
|
||||||
var Profiler;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class from which every other
|
* Base class from which every other
|
||||||
@ -35,7 +34,6 @@ function Node(options) {
|
|||||||
|
|
||||||
this.logger = options.logger;
|
this.logger = options.logger;
|
||||||
this.db = options.db;
|
this.db = options.db;
|
||||||
this.profiler = null;
|
|
||||||
this.mempool = null;
|
this.mempool = null;
|
||||||
this.pool = null;
|
this.pool = null;
|
||||||
this.chain = null;
|
this.chain = null;
|
||||||
@ -53,11 +51,6 @@ function Node(options) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.profile && !utils.isBrowser) {
|
|
||||||
Profiler = require('./prof' + 'iler');
|
|
||||||
this.profiler = new Profiler(this.prefix);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.__init();
|
this.__init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,6 +166,8 @@ Node.prototype._parseOptions = function _parseOptions(options) {
|
|||||||
|
|
||||||
options = utils.merge({}, options);
|
options = utils.merge({}, options);
|
||||||
|
|
||||||
|
options.network = bcoin.network.get(options.network);
|
||||||
|
|
||||||
if (process.env.BCOIN_PREFIX != null)
|
if (process.env.BCOIN_PREFIX != null)
|
||||||
options.prefix = process.env.BCOIN_PREFIX;
|
options.prefix = process.env.BCOIN_PREFIX;
|
||||||
|
|
||||||
@ -194,9 +189,6 @@ Node.prototype._parseOptions = function _parseOptions(options) {
|
|||||||
if (process.env.BCOIN_SEED != null)
|
if (process.env.BCOIN_SEED != null)
|
||||||
options.preferredSeed = process.env.BCOIN_SEED;
|
options.preferredSeed = process.env.BCOIN_SEED;
|
||||||
|
|
||||||
if (process.env.BCOIN_PROFILE != null)
|
|
||||||
options.profile = +process.env.BCOIN_PROFILE === 1;
|
|
||||||
|
|
||||||
if (!options.prefix)
|
if (!options.prefix)
|
||||||
options.prefix = utils.HOME + '/.bcoin';
|
options.prefix = utils.HOME + '/.bcoin';
|
||||||
|
|
||||||
@ -207,8 +199,8 @@ Node.prototype._parseOptions = function _parseOptions(options) {
|
|||||||
|
|
||||||
if (options.logFile && typeof options.logFile !== 'string') {
|
if (options.logFile && typeof options.logFile !== 'string') {
|
||||||
options.logFile = options.prefix;
|
options.logFile = options.prefix;
|
||||||
if (options.network !== 'main')
|
if (options.network.type !== 'main')
|
||||||
options.logFile += '/' + options.network;
|
options.logFile += '/' + options.network.type;
|
||||||
options.logFile += '/debug.log';
|
options.logFile += '/debug.log';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,6 @@
|
|||||||
"jsdoc": "3.4.0",
|
"jsdoc": "3.4.0",
|
||||||
"level-js": "2.2.4",
|
"level-js": "2.2.4",
|
||||||
"mocha": "2.4.5",
|
"mocha": "2.4.5",
|
||||||
"uglify-js": "2.6.1",
|
"uglify-js": "2.6.1"
|
||||||
"v8-profiler": "5.6.1"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user