removed unnecessary console logs

This commit is contained in:
cubedro 2015-04-28 03:52:41 +03:00
parent 2fd2145d54
commit fbc7e90e76
2 changed files with 26 additions and 9 deletions

10
app.js
View File

@ -43,7 +43,7 @@ api.on('connection', function(spark) {
spark.on('hello', function(data)
{
console.log('Latency: ', spark.latency);
console.log('got hello data from ', spark.id);
console.log('Got hello data from ', spark.id);
console.log(data);
if(typeof data.secret === 'undefined' || data.secret !== WS_SECRET)
@ -75,7 +75,7 @@ api.on('connection', function(spark) {
spark.on('update', function(data)
{
console.log('Latency: ', spark.latency);
console.log('got update from ' + spark.id);
console.log('Got update from ' + spark.id);
if(typeof data.id !== 'undefined' && typeof data.stats !== 'undefined')
{
@ -101,9 +101,6 @@ api.on('connection', function(spark) {
spark.on('latency', function(data)
{
console.log('Latency: ', data.latency);
console.log('got ping from ' + spark.id);
if(typeof data.id !== 'undefined')
{
var stats = Nodes.updateLatency(data.id, data.latency);
@ -126,9 +123,6 @@ client.on('connection', function(spark) {
console.log(spark.query);
spark.on('ready', function(data){
console.log('got hello data from ' + spark.id);
console.log(data);
spark.emit('init', {nodes: Nodes.all()});
var blockPropagationChart = Nodes.blockPropagationChart();

View File

@ -70,7 +70,6 @@ History.prototype.add = function(block, id)
}
item.propagTimes.push({node: id, received: now, propagation: block.propagation});
console.log('item: ', item);
this._save(item);
}
this.getNodePropagation(id);
@ -187,6 +186,30 @@ History.prototype.getUncleCount = function(id)
return uncleBins;
}
History.prototype.getTransactionsCount = function(id)
{
var uncles = _(this._items)
.sortByOrder('height', false)
.slice(0, MAX_BINS - 1)
.reverse()
.map(function(item)
{
return item.block.transactions.length;
})
.value();
var uncleBins = _.fill(Array(MAX_BINS), 0);
var sumMapper = function(array, key) {
uncleBins[key] = _.sum(array);
return _.sum(array);
};
_.map(_.chunk(uncles, MAX_UNCLES_PER_BIN), sumMapper);
return uncleBins;
}
History.prototype.history = function()
{
return _.chain(this._items).sortBy('number').reverse().value();