added timestamp console.logs

This commit is contained in:
cubedro 2015-05-04 18:36:24 +03:00
parent 9c5b6e1a46
commit f102185e0a
1 changed files with 12 additions and 1 deletions

View File

@ -357,13 +357,20 @@ Node.prototype.uptime = function()
Node.prototype.getStats = function()
{
var start = _.now();
console.log('==> statsstart: ', start);
if(this._socket)
this._lastStats = JSON.stringify(this.stats);
// if(this.isActive())
if(this._web3)
{
var blockStart = _.now();
console.log('==> blockstart: ', blockStart);
console.log('==> blockstart diff: ', (blockStart - start));
var block = this.getBlock();
var blockEnd = _.now();
console.log('==> blockend: ', blockEnd);
console.log('==> block diff: ', (blockEnd - blockStart));
if( !_.isUndefined(block) && !_.isUndefined(block.number) && !_.isUndefined(block.hash) && block.hash !== '?' )
{
@ -409,6 +416,10 @@ Node.prototype.getStats = function()
}
this.uptime();
var end = _.now();
console.log('==> end: ', end);
console.log('==> stats diff: ', (start - end));
}
Node.prototype.getHistory = function(range)